CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346

    compressed file size vs. uncompressed

    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.

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

  2. #2
    Join Date
    Feb 2001
    Location
    teh INTARWEB
    Posts
    542

    Re: compressed file size vs. uncompressed

    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 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.

  3. #3
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346
    thanks, i just wasn't sure how all that worked (compressed or not)

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured