Re: Numbers for filesys.e for SunOS or any OS?

new topic     » goto parent     » topic index » view thread      » older message » newer message
agrellum said...

How do I calculate the correct numbers for STAT_ST_BLKSIZE and SIZEOF_STAT.

You'll need to know C to do this.

SIZEOF_STAT is easy to calculate. Use the following C program:

#include <sys/stat.h> 
#include <stdio.h> 
void main() 
{ 
	printf("%d\n", sizeof(struct stat)); 
} 

STAT_ST_BLKSIZE is a bit harder. Try this:

#include <sys/stat.h> 
#include <stdio.h> 
void main() 
{ 
	struct stat temp; 
	char * stat_ptr = (char*)(&temp); 
	char * blk_ptr = (char*)(&(temp.st_blksize)); 
	printf("%d\n", blk_ptr - stat_ptr); 
} 

agrellum said...

Also, unless I comment out lines 2325 and 2326, it will not compile.

  2325				stat_t_offset = 80 
  2326				stat_buf_size = 100 

Looks like Matt forgot to clean up some leftover 4.0 code when updating the 4.1 stuff - http://scm.openeuphoria.org/hg/euphoria/annotate/2938e761e722/include/std/filesys.e#2224

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu