File Forks
HFS+ is perhaps most distinctive among filesystems concerning how it allows files to store information in multiple forks . A typical non-Carbonized application for Mac OS 9 stores its executable binary code in a data fork, and supplemental information—such as icons, dialogs, and sounds—is stored in a resource fork. Each fork is a separate subsection of the file. Documents can also have both data and resources forks, which applications can read from and write to as they see fit.
However, Mac OS X is based on Unix, which was built to work with single-forked files, holding nothing except their own data. Modern Mac OS applications eschew all use of resource forks, instead taking one of two paths. They either store all their resources in a separate file with an .rsrc extension, kept inside the application package, or they simply store their resources as separate files inside the package. Carbon applications usually take the former, single-file route for their resources, and Cocoa applications favor the latter.
To accommodate traditional Macintosh applications and files, Mac OS X provides native support for multiple forks on HFS+ volumes, and native-like support on UFS volumes. Copying and moving such files with the Finder works as expected, whether the files reside on an HFS+ or a UFS volume.
Under the hood, however, you’ll find that this task required some special engineering on Apple’s part. Mac OS X stores any resource fork that happens to reside on a UFS volume as a separate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access