Mail Archives: djgpp/1999/07/23/15:55:28
Greetings Darren,
Try the C system call stat() which not only gives you the file size but
also when the file was last modified etc. It takes two arguments: a
string (the filename) and the address to a structure (struct stat *).
The structure field you want is called st_size, which gives the size in
bytes. Example:
struct stat statbuf;
stat("hello.dat", &statbuf);
printf("The size of hello.dat is %d\n", statbuf.st_size);
Hope that works :-)
I know stat() gives more info if you use it on a UNIX system, and I
haven't honestly tried it myself in DOS but I can't see why it shouldn't
work (some fields in the structure will be useless in DOS but don't
worry about that now).
cheers
Fred
Darren Noble wrote:
> Does anyone know how to get the size of a file in DJGPP?
>
> --
> Linux Rules
>
> Darren 'The' Noble
--
Fred Backman
Lead Wizard
Binary Spells
http://www.femmefetish.com/games/
- Raw text -