Mac OS filesystems have the concept of something called "forking". Each file in the mac os is split up into two separate "forks", one for data, one for resources. The forks are separate, but are addressed and treated as one file.

Because of the fact that the file system has to specifically support forking for this to work, if you place certain mac files and most programs on a foreign file system, all forking information is destroyed and the program becomes unusable. This is why the binhex and macbinary formats exist.

Of course one interesting offshoot is this is the way that mac text tiles can be styled completely invisibly-- simpletext stores its text in the data fork, and its style information in the resource fork. Therefore programs not supporting the style information are totally unaware the style information is there, and putting the file on a foreign file system will simply destroy the style information (which would be unreadable there anyway) without harming the data. The exact same works with icons-- the icons are stored in the resource fork of the file, meaning a binary file can safely contain the icon without screwing with the binary data.

In Mac OS X, the concept of the resource fork has been replaced with that of the package, with the items that were once stored as resources (see resource) meant to be stored either as files invisibly stored within the package, or members of flexible XML property lists (although old-school resources can still be saved in .rsrc files, which are just the contents of a resource fork stored in a data fork). All this is done in the interest of allowing mac os x applications and files to be stored on any drive, on any filesystem, while still being executable.

Mac OS X *DOES* still support the resource fork fully, however, and you may access the resource fork of any file from the UNIX subsystem by appending /rsrc to the name of the file. For example, say there is a clipping file named "#everything clipping" on my desktop, and i want to look at it in less; since the contents of clipping files are resources stored in the resource fork, using less on it normally would result in seeing an empty file. typing less "#everything clipping/rsrc", however, spits out some garbage (the resource fork's index information), followed by the contents of the TEXT resource the clipping contains.

Log in or register to write something here or to contact authors.