fgetpos

How do you determine the size of a file (in C) for files that are larger than 4GB?

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,&currentpos); m_filesize=currentpos; ...

c++ fread changing fgetpos strangely

If I run: FILE* pFile = fopen("c:\\08.bin", "r"); fpos_t pos; char buf[5000]; int ret = fread(&buf, 1, 9, pFile); fgetpos(pFile, &pos); I get ret = 9 and pos = 9. However if I run FILE* pFile = fopen("c:\\08.bin", "r"); fpos_t pos; char buf[5000]; int ret = fread(&buf, 1, 10, pFile); fgetpos(pFile, &pos); ret = 10 as expected, ...