View Full Version : How to use stat() function in Qt?

6th August 2012, 07:53
I am using stat function to return the filesize? But it returns -1 everytime.. Or some garbage filesize. How to get the correct file size?
in Windows 7 64 bit.

6th August 2012, 09:11
This is not a Qt question. If you were using QFileInfo or QFile to get the file size this would be a Qt question.

Hint: the standard stat() function's return value is not the file size, and -1 means something. The file attributes are returned in the buffer you pass a pointer to.