Resource fork

related topics
{system, computer, user}
{math, number, function}
{style, bgcolor, rowspan}
{company, market, business}

The resource fork is a construct of the Mac OS operating system used to store structured data in a file, alongside unstructured data stored within the data fork. A resource fork stores information in a specific form, such as icons, the shapes of windows, definitions of menus and their contents, and application code (machine code). For example, a word processing file might store its text in the data fork, while storing any embedded images in the same file's resource fork. The resource fork is used mostly by executables, but every file is able to have a resource fork.


The Macintosh file system

Originally conceived and implemented by programmer Bruce Horn, the resource fork provided three important improvements to the Macintosh file system. First, it allowed all graphical data to be stored on disk until it was needed, then retrieved, drawn on the screen, and thrown away. This software variant of virtual memory helped Apple to reduce the memory requirements of the Apple Lisa from 1 MB to 128 KB in the Macintosh. Second, because all the pictures and text were stored separately in a resource fork, for the first time it allowed a non-programmer to translate an application for a foreign market, a process called internationalization and localization. And finally, it allowed nearly all of the components of an application to be distributed in a single file, reducing clutter and simplifying application installation and removal.

The resource fork is implemented in all of the filesystems used for system drives on the Macintosh (MFS, HFS and HFS Plus). The presence of a resource fork makes it easy to store a variety of additional information, such as allowing the system to display the correct icon for a file and open it without the need for a file extension in the file name. While access to the data fork works like file access on any other operating system — pick a file, pick a byte offset, read some data — access to the resource fork works more like extracting structured records from a database. Microsoft Windows also has a concept of “resources”, but these are completely different from resources in Mac OS.

Full article ▸

related documents
Buffer overflow
Parallel computing
Algorithmic efficiency
X86 architecture
One-time pad
Timeline of computing 2400 BC–1949
Java Platform, Standard Edition
Library (computing)
Hardware description language
ARM architecture
PID controller
Super Audio CD
Audio crossover
Commodore 128
Application-specific integrated circuit
Remote control
Wavelength-division multiplexing