Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an "Icon?" file?

Tags:

file

macos

After changing account in my Google Drive on a Windows machine, every directory when synced with my mac now has an "Icon?" file with no extension and apparently no contents.

This has happened once before after I cloned a Git directory. It gets listed on the Atom project tree simply as "Iconr"

Here is a screenshot of the file:

enter image description here

And this is the information I get:

enter image description here

Anyone know what this is? ... Doesn't seem to be doing anything ... But is making me curious!

like image 895
Pedro Coitinho Avatar asked Mar 08 '17 18:03

Pedro Coitinho


1 Answers

When setting a custom icon on a folder this is where the Finder stores the image. The file itself is not visible in the Finder (but you can see it in the shell).

You can use the getFileInfo tool to see the Finder flags:

$ getFileInfo Icon^M
...
attributes: aVbstclinmEdz
...

The capital V means the invisible bit is set. If that is not the case on your system, you'll see the file in the Finder. Loosing the Finder flags is not uncommon when you transport your files through hostile territory as Google or Windows land :)

The "Icon?" files are ancient technology from Mac OS classic where (if I remember correctly) custom icons were stored in the resource fork of a file. But because folders did not have resource forks a different way to store the icon was needed and so engineers came up with the idea of a hidden file.

The filename is actually "Icon" + CR. CR is the line termination character in Mac OS classic. This name was selected to make it impossible to conflict with human entered filenames.

Oh, and, because you made me remember this stuff from more than 20 years ago, I'll save you the vote-to-close (because your question is actually off topic for Stack Overflow) :)

like image 64
Nikolai Ruhe Avatar answered Oct 05 '22 06:10

Nikolai Ruhe