Filesize greater than contents of file?
Hey guys, I'm working on a file transfer program right now, and I've figured out a way to get the size of a file though it may not be the best way. The thing is, I get a different size from what Windows says in explorer, and when I use CreateFile() then GetFileSize() on the file, it also gives the size Windows gives.
In my version:
-open a file in read mode
-keep reading 1 character at a time, incrementing a counter
-if eof(), quit the loop (before incrementing the counter)
This consistently gives me a smaller filesize than Windows, and I can't figure out why. Also, I'm guessing that if I used the Windows filesize (send it over to the server so the server knows when the file is done receiving), the server would have to wait a long time for the client to "finish" sending the file.
My question is, why does Windows make the filesize bigger? It says "size: (...) bytes, (...) bytes used" with the bytes used bigger, but even the actual size is too big according to what I can see. Why is this? :confused: