Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
div
eof
Expand Minimize
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.

_filelength, _filelengthi64

Gets the length of a file.

long _filelength( 
   int fd 
);
__int64 _filelengthi64( 
   int fd 
);

fd

Target the file descriptor.

Both _filelength and _filelengthi64 return the file length, in bytes, of the target file associated with fd. If fd is an invalid file descriptor, this function invokes the invalid parameter handler, as described in Parameter Validation. If execution is allowed to continue, both functions return –1L to indicate an error and set errno to EBADF.

Function

Required header

_filelength

<io.h>

_filelengthi64

<io.h>

For more compatibility information, see Compatibility in the Introduction.

See the example for _chsize.

Community Additions

ADD
Show:
© 2015 Microsoft