Click to See Complete Forum and Search --> : compressed file size vs. uncompressed


Waldo2k2
July 12th, 2002, 12:55 PM
On the windows platform, I've noticed that in the properties tab for files, it lists the size, and then the bytes used, it generally takes up more bytes than the file size, does this mean that the file is compressed? I need to know because there are two API functions to pick between, one for getting the compressed file size and one for the uncompressed. I don't want to read too many bytes, and i don't want to read too few.

Manish Malik
July 12th, 2002, 06:02 PM
Originally posted by Waldo2k2
On the windows platform, I've noticed that in the properties tab for files, it lists the size, and then the bytes used, it generally takes up more bytes than the file size, does this mean that the file is compressed?

No, it is actually slack space (http://webopedia.lycos.com/TERM/S/slack_space.html) that gives you the difference.

The GetCompressedFileSize (I think you were talking abt this) API call gets the actual bytes used with compression on volumes that support compression (e.g. if on an NTFS partition, you chose to store a large text file in "Compressed" form, this will return the actual bytes in the compressed form). If the volume doesn't support compression, its return value will be same as GetFileSize or GetFileSizeEx.

You should use GetFileSizeEx to get the filesize, not bothering about the compression, the OS will handle it.

Waldo2k2
July 13th, 2002, 09:00 AM
thanks, i just wasn't sure how all that worked (compressed or not)