forlano Messages: 1207 Registered: March 2006 Location: Italy
Senior Contributor
Hello,
do we have a sort of FileSize that return how many byte is a file long?
I am tempted to load the file with LoadFile() and then use GetCount(), but I am afraid to not get the correct result in case of binary file or doing something that can backfire.
The function you are looking for is GetFileLength().
const char *filepath = "./somedocument.pdf";
DDUMP(GetFileLength(filepath));
// Or
FileIn fi(filepath);
if(fi) DDUMP(fi.GetSize());
//Or (this is basically the same as GetFileLength()
FindFile ff(filepath);
if(ff) DDUMP(ff.GetLength());