What's in a resource fork? Where are the icons?


Cleaning up old records/Recording to CD
Back
Useful Mac sites

From http://www.macdisk.com

Resource fork
The resource fork may contain the code of a program, the commands of a font
file, etc. Some programs store a preview picture in the resource fork.
Against what is often said, the resource fork doesn't contain the signature
of Macintosh files (file type and file creator).

What are signatures?
The Macintosh doesn't use the three-byte (or even more than three, like
under Unix) extension concept to identify files, but signatures. Signatures
are strings of eight bytes, four for the creator (the program which created
the file) and four for the file type (text, picture, and so on).
The correspondence between signatures and icons is managed by the Finder,
for all programs which happened to exist on a volume, in the Desktop file
(an hidden system file which is never shown by the Macintosh but exists on
every disk). With System 7 and upwards, the Desktop graduated to a double
Desktop DB + Desktop DF, for reasons which would led us too far away from
our main issue.

Where are signatures stored?
These signatures, against what is often mentioned, even by knowledgeable
persons, are not saved in the resource fork of each file, but in the catalog
tree (on the disk, in a management structure you will [hopefully] never have
to look at).
This mistake finds its origin in the fact that the programs (and only the
programs, not the data files)

***put the icons they use in their resource fork***

and have to declare (in a bundle resource placed in their resource fork) the
signature of the files they intend to manage, so that the Finder knows what
to do when the user double-clicks on an icon. Another source of errors comes
from the fact that some graphic files save in the resource fork a preview
picture of the file (thumb nail to display on the desktop).

*****

So, I would interpret the above to mean that the program puts the icon in
the resource fork.

You can learn more about resource forks by going to:

http://www.cs.msstate.edu/~smithg/ResCafe/

ResCafé is a Swing-based Java utility for reading and extracting resources
such as ICONs and MENUs from the Resource Forks of Macintosh files. It is
somewhat similar to ResEdit on MacOS except that it is not an editor; it
operates on files in a read-only fashion.

...or the Apple website and learn more about Resedit and resource forks:

http://www.devworld.apple.com/

Do a search on Resedit...

Summary : ResEdit Reference . ResEdit is Apple Computer's award-winning
resource-editing utility for the Macintosh and Mac OS-compatible computers.
It lets you quickly create and incorporate resources, standard data
structures such as menus, dialog boxes, and icons...