Welcome, Guest. Please
login
or
register
.
Forums
Forums
Board
Topic
Home
Today's Posts
Gallery
Login
Register
Amiga.org
»
Operating System Specific Discussions
»
Amiga OS
»
Amiga OS -- Development
»
The size of a file
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: The size of a file (Read 2120 times)
Description:
0 Members and 1 Guest are viewing this topic.
srg86
Full Member
Join Date: Aug 2004
Posts: 211
The size of a file
«
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
Logged
Piru
\' union select name,pwd--
Hero Member
Join Date: Aug 2002
Posts: 6946
Re: The size of a file
«
Reply #1 on:
May 03, 2005, 07:59:48 PM »
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.
Logged
Fats
Hero Member
Join Date: Mar 2002
Posts: 672
Re: The size of a file
«
Reply #2 on:
May 03, 2005, 07:59:57 PM »
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.
Logged
Trust me... I know what I\'m doing
Piru
\' union select name,pwd--
Hero Member
Join Date: Aug 2002
Posts: 6946
Re: The size of a file
«
Reply #3 on:
May 03, 2005, 08:03:05 PM »
@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.
Logged
srg86
Full Member
Join Date: Aug 2004
Posts: 211
Re: The size of a file
«
Reply #4 on:
May 03, 2005, 09:09:53 PM »
I've found Examine, but I can't find what header file ExamineFH is in.
srg
Logged
Doobrey
Hero Member
Join Date: Oct 2002
Posts: 1876
Re: The size of a file
«
Reply #5 on:
May 03, 2005, 11:31:13 PM »
It`s in dos.h , the same as Examine
Logged
On schedule, and suing
srg86
Full Member
Join Date: Aug 2004
Posts: 211
Re: The size of a file
«
Reply #6 on:
May 04, 2005, 02:08:57 PM »
doh!!!!!!!!!
srg
P.S. doh!!!!!
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Amiga.org
»
Operating System Specific Discussions
»
Amiga OS
»
Amiga OS -- Development
»
The size of a file
There was an error while thanking
Thanking...