[解决办法] _filelength, _filelengthi64 Get the length of a file.
long _filelength( int handle );
__int64 _filelengthi64( int handle );
Function Required Header Compatibility _filelength <io.h> Win 95, Win NT _filelengthi64 <io.h> Win 95, Win NT
For additional compatibility information, see Compatibility in the Introduction.
Libraries
LIBC.LIB Single thread static library, retail version LIBCMT.LIB Multithread static library, retail version MSVCRT.LIB Import library for MSVCRT.DLL, retail version
Return Value
Both _filelength and _filelengthi64 return the file length, in bytes, of the target file associated with handle. Both functions return a value of –1L to indicate an error, and an invalid handle sets errno to EBADF.
Parameter
handle
Target file handle
Example
/* CHSIZE.C: This program uses _filelength to report the size * of a file before and after modifying it with _chsize. */