View Single Post
Old 23rd November 2014, 18:20   #25  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
I think what you are looking for should be _fseeki64(), not _fseek64(). As a little extra challenge for us, Linux/glibc calls this fseeko64()

Also, any reason you prefer determining the file size using the _fseeki64() plus _ftelli64() "workaround" rather than calling _fstati64() right away?

EDIT: I just noticed that the MSVC CRT even has a _filelengthi64() function, available in VC 6.0, which makes it even simpler

Code:
#include <io.h>

__int64 getFileSize64(FILE *const fp)
{
	return _filelengthi64(_fileno(fp));
}
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 23rd November 2014 at 22:06.
LoRd_MuldeR is offline   Reply With Quote