osx - Mac OS X Finder: Substantial disparity between "Size" and "on disk" values for file

08
2013-08
  • Questioner

    On Mac OS X (I'm using 10.8/Mountain Lion), you can inspect files in the Finder via Option-Click -> "Get Info". Doing so opens a panel with all sorts of information. In the top right corner, you can see the file size in MB. Next to "Size" (filed unter "General"), you get more detailed information: The size in bytes, as well as another size in MB on disk.

    I noticed that some files have a substantial difference between their size in bytes/the value in the top right corner, and the on disk value. One example is the Clang binary: Size disparity in Finder

    Can anyone explain why there's such a huge difference (26.3MB vs. 10.9MB)? Are parts of the file shared (I have installed the Xcode command line tools, so the file exists in multiple locations)?

  • Answers
  • bdash

    HFS+ compression!

    The "Size" value represents the uncompressed size of the data in the file. The "on disk" value is how much storage is really needed for the compressed data. The Mac OS X Hints site provides background on how this compression is implemented, and provides a link to the helpful hfsdebug tool that can be used to get information on compressed files.


  • Related Question

    osx - OS X: Show exact file size in Finder
  • kpozin

    Is there a way to get Finder to show exact file size in List view, rather than only showing Size on Disk? I know it's possible to see the exact size by opening the file info window, but I'm looking for a solution that works in List view.


  • Related Answers
  • Mark Thalman

    I don't think there is a way to do this. Why do you need the exact size? What problem are you trying to solve?

  • mikl

    Whenever you have a file selected, you can press ⌘I to bring up "Show info", that will tell you, among other things, the exact filesize in bytes. I do not know a way to get that information in the column view, though – sorry.

  • 8088

    The wonderful dual-pane file manager Forklift uses "real" file sizes in its list view by default:

    forklift