_filelength, _filelengthi64
Visual Studio .NET 2003
Get the length of a file.
long _filelength( int fd ); __int64 _filelengthi64( int fd );
Parameter
- fd
- Target file descriptor.
Return Value
Both _filelength and _filelengthi64 return the file length, in bytes, of the target file associated with fd. Both functions return a value of –1L to indicate an error, and an invalid file descriptor sets errno to EBADF.
Requirements
| Function | Required header | Compatibility |
|---|---|---|
| _filelength | <io.h> | Win 98, Win Me, Win NT, Win 2000, Win XP |
| _filelengthi64 | <io.h> | Win 98, Win Me, Win NT, Win 2000, Win XP |
For additional compatibility information, see Compatibility in the Introduction.
Libraries
All versions of the C run-time libraries.
Example
See the example for _chsize.
See Also
File Handling Routines | _chsize | _fileno | _fstat | _fstati64 | _stat | _stati64 | Run-Time Routines and .NET Framework Equivalents