Transferred from
http://www.codeproject.com/UserItems/filesize.asp
#include
#include
__INT64 FILSIZE64 (const char * szfilename)
{
Struct __stat64 fileestat;
Int err = _stat64 (szfilename, & fileestat);
IF (0! = Err) Return 0;
Return FileStat.st_size;
}
#include
#include
Int filesize (const char * szfilename)
{
Struct stat Filestat;
Int err = stat (szfilename, & fileestat);
IF (0! = Err) Return 0;
Return FileStat.st_size;
}
#include
Int filesize (const char * sfilename)
{
Std :: ifstream f;
F.Open (sfilename, std :: os_base :: binary | std :: ios_base :: in);
IF (! f.good () || f.eof () ||! f.is_open ()) {return 0;}
F.seekg (0, std :: os_base :: beg);
Std :: ifstream :: pOS_TYPE BEGIN_POS = f.tellg ();
F.seekg (0, std :: os_base :: end);
Return static_cast
}
#include
Boost :: INTMAX_T FILE_SIZE (Const Path & P);