Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: srg86 on May 03, 2005, 07:36:50 PM
-
Hi
How do I find out the size of a file is using AmigaDOS calls (I don't think there is anything to do this in the standard C library but I could be wrong).
thanks
srg
-
dos.library/Examine
dos.library/ExamineFH
Occasionally also code using dos.library/Seek can be seen, but this method is really really slow with FFS and large files, and should be avoided.
-
You can do it in ANSI-C on an open file like this:
fseek(f, 0, SEEK_END);
size = ftell(f);
the conversion to Amiga function calls I leave as an exercise :-)
greets,
Staf.
-
@Fats
...which is really slow with FFS and large files. Should be avoided.
If you don't need ANSI-C, use fstat (or stat). Even SAS/C linklibs have it.
-
I've found Examine, but I can't find what header file ExamineFH is in.
srg
-
It`s in dos.h , the same as Examine ;)
-
doh!!!!!!!!!
srg
P.S. doh!!!!!