2

Is there a canonical way to check the size of a file in Windows? Googling brings me both Find­First­File and GetFileSizeEx but no clear winner. And must GetLastError always be called too?

1

1 Answer 1

2

If you just want the size, the GetFileSizeEx is the clear winner. Yes, FindFirstFile will do the job too, but it's really intended for other purposes, and unless you need to do those other things, its use is likely to mislead or confuse the reader.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.