Re: Length of a file in C/C++
Re: Length of a file in C/C++
- Subject: Re: Length of a file in C/C++
- From: Javier Blanque <email@hidden>
- Date: Fri, 20 May 2005 15:43:03 -0300
Also, you can use lseek to see the lenght of a file.
#include <unistd.h>
off_t lseek(int fildes, off_t offset, int whence);
you can say:
file_lenght = lseek(my_file, 0, SEEK_END);
which is useful for "memory allocation purposes" in case you want to
put your entire file in RAM. See man lseek at the console app.
Best regards,
Javier Blanque
El 20/05/2005, a las 09:45, Theodore H. Smith escribió:
This is a very basic question, but I've never needed to do this before
anyhow. How do you tell the length of a file using standard C/C++
functions? And how do you navigate the file system with these
functions also?
All the docs I've seen on fread/fopen and family don't mention
anything about telling you how much data to read, or how to find out
what files there are to read.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden