Why is my file size shown as Zero bytes in Mac Finder?

21,498

It could be filesystem data structure corruption. Use Disk Utility to run a First Aid repair pass on that volume.

Share:
21,498

Related videos on Youtube

Mathijs
Author by

Mathijs

Updated on September 18, 2022

Comments

  • Mathijs
    Mathijs over 1 year

    I have OS X El Capitan Version 10.11.6 (15G31). I have a file with contents in it, but Finder shows that the file is Zero bytes?!?

    What does this mean? How can the file be zero bytes if there is clearly something in the file?

    I can see that the file is not empty by opening it with any text editor, or if I make a copy of the file it's now 1KB.

    Also, if I 'cd' into that folder using the terminal (aka command line) then it shows the file size as it should be.

    What could possibly be going on here?

    • Mathijs
      Mathijs almost 7 years
      Turns out, the same thing happens on Windows. It must be the application creating the file.
    • Cerniuk
      Cerniuk over 5 years
      If you want a real shock, search in the Finder for files of 0 (zero) KB size. Mine, 905 including documents created 10-Dec-2018 and as far back as 1995.
    • SMBiggs
      SMBiggs about 5 years
      I know this is waaay after the fact, but how could an application fool the operating system about a file's size? It seems to be the case (happens for me with Gimp), but I'm curious about how.
  • Mathijs
    Mathijs almost 7 years
    It's weird it's just the one file. Maybe it's the application creating the file. It's a log file spit out using log4j from a Java application.
  • Mathijs
    Mathijs almost 7 years
    The weird thing is that this application generates other log file without this issue and other types of files in other places with no issue.
  • Peregrino69
    Peregrino69 over 2 years
    This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
  • Community
    Community over 2 years
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.