The code currently does this and the fgetpos does handle files larger than 4GB but the seek returns an error, so any idea how to seek to the end of a file > 4GB?
fpos_t currentpos; sok=fseek(fp,0,SEEK_END); assert(sok==0,'Seek error!'); fgetpos(fp,¤tpos); m_filesize=currentpos;
If you’re in Windows, you want GetFileSizeEx (MSDN). The return value is a 64bit int.
On linux stat64 (manpage) is correct. fstat if you’re working with a FILE*.