Pages

Friday, May 25, 2012

C++ File _stat() _stat64i32()

MSDN

#include <sys/types.h> followed by
#include <sys/stat.h>

#define _stat64i32() _stat()

is used to get file information. 
If the file size is larger than 2 GB, the 32-bit status functions return successfully (0) but report an incorrect file size. If you know that the file size might be larger than 2 GB, use one of the 64-bit status functions, such as _stat64 Or following method.

use
FILE * pFile;
fseek (pFile , 0 , SEEK_END);            Move to End
fpos_t pos;
fgetpos(pFile,&pos);                     Get Position

fpos_t is __int64 so 8 byte.

No comments:

Post a Comment