Re: How do I get a files length
- From: "Aaron Gray" <ang.usenet@xxxxxxxxx>
- Date: Fri, 25 Apr 2008 23:56:24 +0100
"Rikishi 42" <skunkworks@xxxxxxxxxxxxx> wrote in message
news:r1n9e5-s1m.ln1@xxxxxxxxxxxxxxxxxxxxxx
On 2008-04-25, Aaron Gray <ang.usenet@xxxxxxxxx> wrote:
"Rikishi 42" <skunkworks@xxxxxxxxxxxxx> wrote in message
news:0lh9e5-t8l.ln1@xxxxxxxxxxxxxxxxxxxxxx
On 2008-04-25, Aaron Gray <ang.usenet@xxxxxxxxx> wrote:
How do I get the length of a file, hopefully without moving the
current
position.
You can stat(2) ("man 2 stat") or fstat(2) ("man 2 fstat") the file.
The
st_size of the returned stat structure will identify the "total size,
in
bytes" of the file.
Thanks but is there a separate function not requiring a struct ?
Yes. Stat. rtfm allready.
Yeah, how ?
How what? To get the size, or to rtfm ?
Shame the API's so crappy. So is man compared to HTML too. I develop on
Windows as it is quicker has nicer APIs and tools then I have a job porting
what I have done to Linux and Mac OS X.
Yeah its simple but windows has a single function to get the size of an open
file. *nix has some god damb struct that is as bad as X Windows'es data
structures, all that for one value. Then I have to wrap the darn thing to
make a portable API for my app, where if it had been a single function call
returniing the size I could have used a #define.
Waste of time, please read all the fuuking manuals and rewite the API's
while you are at it !
Aaron
.
- Follow-Ups:
- Re: How do I get a files length
- From: Beej Jorgensen
- Re: How do I get a files length
- References:
- How do I get a files length
- From: Aaron Gray
- Re: How do I get a files length
- From: Lew Pitcher
- Re: How do I get a files length
- From: Aaron Gray
- Re: How do I get a files length
- From: Rikishi 42
- Re: How do I get a files length
- From: Aaron Gray
- Re: How do I get a files length
- From: Rikishi 42
- How do I get a files length
- Prev by Date: Re: How do I get a files length
- Next by Date: Re: How do I get a files length
- Previous by thread: Re: How do I get a files length
- Next by thread: Re: How do I get a files length
- Index(es):
Relevant Pages
|
|