1

I occasionally find empty files instead of more or less important documents. Fortunately no real damage so far because I have many backup systems (including good old paper).

The file exists with its name intact but the content is empty. The file is displayed by the finder with "Zero bytes size" (to be correct: it should be "Zero byte size").

The file type is usually jpg or pdf. These are the types I include in LaTeX documents and refer to with Unix hard links (ln).

I have been tracking this problem for a long time but found no explanation and no way to reproduce systematically.

I even wrote a script in order to detect the replacement of a full file by an empty file with the same name at backup but yet could not pin it down.

Has anyone noticed the same phenomenon?

  • Actually, it is correct - zero bytes, one byte, two bytes… ;) – Tetsujin Apr 24 '20 at 09:27
  • Slightly familiar problem indeed. Can you give an estimate as to how big these original files were? And exactly how you created the links? (And why not soft-links/aliases?) Do you use any other filesystem manipulations? (Cleaners, compressors, attribute changers, repair programs) – LаngLаngС Apr 24 '20 at 09:34
  • What filing system are the files stored on? Can you explain your process of "referring with hard links"? Does the modification date of the file provide any clues of when this happens? – benwiggy Apr 24 '20 at 09:50
  • 100 kB to 3 MB. I use the unix command ln. I cannot use aliases because latex does not recognize them: they are not unix objects. I tried to use symlinks (ln -s) but I was unhappy with them, I don't remember why. I use backup fortunately! No cleaner. YES I have kept one empty file and I realize the the modification date is meaningful. So I know what to do next: keep empty files and correlate the modification dates. – Pierre ALBARÈDE Apr 24 '20 at 10:31
  • I have just made a search of empty files and found a handful of them that have absolutely no reason of being empty. Most of them are dead hard links. I take one interesting. The modification date is 20180701. I also have the original elsewhere and it has the same modification date 20180701. This file was included in a LaTeX document on 20160406. So I understand now: on 20180701 something altered the original file, thus killing the hard link. I did'nt do it. I have no reason to alter a PDF file. What dit it? – Pierre ALBARÈDE Apr 24 '20 at 10:43
  • Forgot to mention I use Time Machine. – Pierre ALBARÈDE Apr 24 '20 at 10:47
  • Is this an old mechanical drive? have you checked that the disk is verified? – benwiggy Apr 24 '20 at 11:53
  • I have had plenty of mechanical disk failures (maybe every 6 to 12 months). Could it be that the file repair system based on journaling does not preserve the file ID (as given by stat)? I am on SSD since fall 2018 but I still see more recent Zero bytes, possibly in smaller numbers than before. – Pierre ALBARÈDE Apr 24 '20 at 12:03
  • I forgot this: I use the file system Mac OS X extended, that is the basic Mac stuff. It is journaled. – Pierre ALBARÈDE Apr 24 '20 at 20:34

0 Answers0