_filelength, _filelengthi64
div
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

_filelength, _filelengthi64

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

Show:
© 2016 Microsoft