Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
_filelength, _filelengthi64
Collapse the table of content
Expand the table of content

_filelength, _filelengthi64

Get the length of a file.

long _filelength( 
   int fd 
__int64 _filelengthi64( 
   int 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.


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.


All versions of the C run-time libraries.


See the example for _chsize.

See Also

File Handling Routines | _chsize | _fileno | _fstat | _fstati64 | _stat | _stati64 | Run-Time Routines and .NET Framework Equivalents

© 2015 Microsoft