3

A bunch of files behave odd in Finder.

  • I cannot not tag, rename, or open them.
  • Opening their info dialog shows everything greyed out, no interactions possible.

How did I get into the problem

  • I did some heavy multi-stage processing of hundreds of PNG files.
  • In between I duplicated a whole folder (and the files in it) to then process the files through the next stage. And tagged the files with the processing they received.
  • As such I kept all intermediary stages in folders. And each file grew by a tag per each processing stage to document what was done on it specifically (they got different treatment).
  • Should I mess up along the way, I could always go back phase by phase due to my incremental folder backups.
  • Thank to APFS being a copy-on-write system that folder duplication worked ultra fast.
  • But along the duplications and tagging something must have went wrong. In the final folder some of the files showed the odd behavior described above.

Investigation

  • Checked unix file permissions, owner, etc.
  • Compared every attribute by mdls between one of the broken files vs. one of the working files.
  • Also compared if some of the exotic Mac filesystem flags may have been set differently with GetFileInfo -a plus the respective attribute letter, such as locked or inited. No luck either. Found no anomalies whatsoever.
  • Relaunching Finder or restarting the Mac didn't help either.

What can be the reason for this odd behavior?

1 Answer 1

7

File in Finder cannot be renamed tagged opened due to bad creation date

Reason: The Creation Date of those files was broken/invalid

After much investigation I had finally found the reason

  • All the files that showed these strange symptoms had two things in common:
  • A common Finder tag which I assigned them in a massive batch assignment (500 files or more at once).
  • They all had a Creation Date of 1984-02-24 (aka January 24th, 1984) the birth date of the Macintosh.
    • This is the fallback date if the creation date is 0 or NULL or otherwise invalid I assume.
    • So during the batch assignment of tags something broke and left the file dates in a bad state.

How to fix these broken files

  • If the creation dates don't matter to you, just set them to the same as the modification date.
    • By your tool of choice, e.g.:
      • A Better Finder Attributes
      • SetFile -d "$(GetFileInfo -m "broken-file.ext")" broken-file.ext
    • Or by a gratis and builtin function of Finder:
      • You can simply zip the file(s)s with Finder's integrated ZIP command.
      • Right-click file(s) > Compress.
      • All macOS metadata is preserved (Finder Tags, Spotlight Comment, dates, permissions, etc).
      • And when unzipping the file plus all metadata is restored and the broken/invalid creation dates are fixed automatically.
  • In my case preserving the creation dates mattered to understand the image file genesis.
    • But due to having worked with incremental backups, I could restore them from one of the intermediary folder. And just tag them again.
    • And this time I left the Finder window in front, until all tags updated (can take some 20-60 seconds when tagging hundreds/thousands of files) not to mess it up again. I guess having done something else in Finder while the tagging process was in process caused the mess up in the first place.
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .