Resource fork
Encyclopedia
The resource fork is a construct of the Mac OS
Mac OS
Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer 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
Machine code
Machine code or machine language is a system of impartible instructions executed directly by a computer's central processing unit. Each instruction performs a very specific task, typically either an operation on a unit of data Machine code or machine language is a system of impartible instructions...

). 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 executable
Executable
In computing, an executable file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful. These instructions are traditionally machine code instructions for a physical CPU...

s, but every file is able to have a resource fork.

The Macintosh file system

Originally conceived and implemented by programmer Bruce Horn
Bruce Horn
Bruce Lawrence Horn was a programmer with Apple Computer and the creator of the Macintosh Finder and the Macintosh Resource Manager. His signature is amongst those molded to the case of the Macintosh 128K....

, the resource fork was used for three purposes with Macintosh file system
Hierarchical File System
Hierarchical File System is a file system developed by Apple Inc. for use in computer systems running Mac OS. Originally designed for use on floppy and hard disks, it can also be found on read-only media such as CD-ROMs...

. First, it was used to store all graphical data on disk until it was needed, then retrieved, drawn on the screen, and thrown away. This software variant of virtual memory
Virtual memory
In computing, virtual memory is a memory management technique developed for multitasking kernels. This technique virtualizes a computer architecture's various forms of computer data storage , allowing a program to be designed as though there is only one kind of memory, "virtual" memory, which...

 helped Apple to reduce the memory requirements of the Apple Lisa
Apple Lisa
The Apple Lisa—also known as the Lisa—is a :personal computer designed by Apple Computer, Inc. during the early 1980s....

 from 1 MB to 128 KB in the Macintosh. Second, because all the pictures and text were stored separately in a resource fork, it could be used to allow a non-programmer to translate an application for a foreign market, a process called internationalization and localization
Internationalization and localization
In computing, internationalization and localization are means of adapting computer software to different languages, regional differences and technical requirements of a target market...

. And finally, it could be used to distribute nearly all of the components of an application in a single file, reducing clutter and simplifying application installation and removal.

The resource fork is implemented in all of the file system
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

s used for system drives on the Macintosh (MFS
Macintosh File System
Macintosh File System is a volume format created by Apple Computer for storing files on 400K floppy disks. MFS was introduced with the Macintosh 128K in January 1984....

, HFS
Hierarchical File System
Hierarchical File System is a file system developed by Apple Inc. for use in computer systems running Mac OS. Originally designed for use on floppy and hard disks, it can also be found on read-only media such as CD-ROMs...

 and HFS Plus
HFS Plus
HFS Plus or HFS+ is a file system developed by Apple Inc. to replace their Hierarchical File System as the primary file system used in Macintosh computers . It is also one of the formats used by the iPod digital music player...

). 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
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...

. Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 also has a concept of “resources”, but these are completely different from resources in Mac OS.

The resource fork is sometimes used to store the metadata
Metadata
The term metadata is an ambiguous term which is used for two fundamentally different concepts . Although the expression "data about data" is often used, it does not apply to both in the same way. Structural metadata, the design and specification of data structures, cannot be about data, because at...

 of a file, although it can also be used for storing the actual data, as was the case with font files in the classic Mac operating systems. Note that the Macintosh file systems also have a separate area for metadata distinct from either the data or resource fork. Being part of the catalogue entry for the file, it is much faster to access this. However, the amount of data stored here is minimal, being just the creation and modification timestamps, the file type and creator codes, fork lengths, and the file name.
Some files have only a resource fork. Classic 68k
68k
The Motorola 680x0/m68000/68000 is a family of 32-bit CISC microprocessors. During the 1980s and early 1990s, they were popular in personal computers and workstations and were the primary competitors of Intel's x86 microprocessors...

 applications are one example, where even the executable code is contained in resources of type ‘CODE’. Later PowerPC
PowerPC
PowerPC is a RISC architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM...

 binaries store the executable code in the data fork.

As resource forks are supported only on the file systems HFS and HFS Plus, they cannot be used on operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s which use other file systems. At present, HFS is supported only by the Macintosh operating system, which means that only machines running Mac OS can use resource forks. Even in a Mac OS system, resource forks cannot be used if the Unix File System
Unix File System
The Unix file system is a file system used by many Unix and Unix-like operating systems. It is also called the Berkeley Fast File System, the BSD Fast File System or FFS...

 has been installed
Installation (computer programs)
Installation of a program is the act of putting the program onto a computer system so that it can be executed....

. In the HFS Plus file system, which is currently the system most commonly used under Mac OS, settings can be made to allow other forks in addition to the data and resource forks, to create a “multi-fork” application. However, as forks can make it difficult to exchange files with other operating systems, this feature is not in common use. Even in Mac OS X, resource forks are seldom used anymore.

Currently, Mac OS X does support resource forks on Windows SMB
Server Message Block
In computer networking, Server Message Block , also known as Common Internet File System operates as an application-layer network protocol mainly used to provide shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network. It also provides an...

 shares by creating a hidden file in the same directory with the data fork file, with the characters “._” at the beginning of the file name. However, this may be annoying for some users, especially because some Windows power user
Power user
A power user is a user of a personal computer who has the ability to use advanced features of programs which are beyond the abilities of "normal" users, but is not necessarily capable of programming and system administration...

s always keep hidden files visible. Besides, Windows does not treat those files correctly as the file itself is moved or removed. A few resource fork files created by Mac OS X on an SMB share can be disabled by an Apple supported action.

Resource identifiers

Each resource has an OSType
OSType
OSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...

 identifier (a four byte value) and an ID (a signed
Signedness
In computing, signedness is a property of data types representing numbers in computer programs. A numeric variable is signed if it can represent both positive and negative numbers, and unsigned if it can only represent non-negative numbers .As signed numbers can represent negative numbers, they...

 16-bit word), as well as an optional name. There are standardised resource types for dialog box
Dialog box
In a graphical user interface of computers, a dialog box is a type of window used to enable reciprocal communication or "dialog" between a computer and its user. It may communicate information to the user, prompt the user for a response, or both...

es (‘DITL’), images (‘PICT
PICT
PICT is a graphics file format introduced on the original Apple Macintosh computer as its standard metafile format. It allows the interchange of graphics , and some limited text support, between Mac applications, and was the native graphics format of QuickDraw.The original version, PICT 1, was...

’), sounds (‘snd ’) — and even for executable
Executable
In computing, an executable file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful. These instructions are traditionally machine code instructions for a physical CPU...

 binaries (‘CODE’) which, until the advent of the PowerPC
PowerPC
PowerPC is a RISC architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM...

 processor
Central processing unit
The central processing unit is the portion of a computer system that carries out the instructions of a computer program, to perform the basic arithmetical, logical, and input/output operations of the system. The CPU plays a role somewhat analogous to the brain in the computer. The term has been in...

, were without exception stored in the resource fork. Subroutines for rendering window
Window (computing)
In computing, a window is a visual area containing some kind of user interface. It usually has a rectangular shape that can overlap with the area of other windows...

s are stored in their own type of resources (‘WDEF’), subroutines for rendering menus in theirs (‘MDEF’), and if there is a type of data you think does not fit any of the standardised categories, you can just as well use a type of your own (e.g. ‘John’) — actually any four characters or 32-bit value can serve as a resource type. This arrangement enabled users to easily customise not only individual applications but also the operating system itself, using tools such as ResEdit
ResEdit
ResEdit was a developer tool application for the Apple Macintosh, used to create and edit resources directly in the Mac's resource fork architecture. It was an alternative to tools such as REdit, and the resource compiler Rez. For the average user, ResEdit was generally easier to use, because it...

 to modify the resources of an application file or any of the system files.

Within an application or other code, resources can be loaded simply using a combination of their type, ID or name, without regard to how and where they are stored in the resource fork. The client is returned a Handle
Reference (computer science)
In computer science, a reference is a value that enables a program to indirectly access a particular data item, such as a variable or a record, in the computer's memory or in some other storage device. The reference is said to refer to the data item, and accessing those data is called...

 to the loaded resource which can then be accessed like any other heap-based data. The OS component that facilitates this is the Resource Manager. In addition to abstracting the details of the data storage from the data itself, the Resource Manager also arranges sets of open resource forks into a stack, with the most recently opened file on top. When trying to load a resource, it will look in the top of the stack first, (perhaps the current document's resource fork), then the next one down (the application's resource fork), then the next one (system resource forks). This arrangement is very powerful — it permits local resources to override more global ones lower down — so an application can provide its own icons or fonts in place of the standard system ones, for example. It also allows an application to load resources from the system using the same API as any other resource, without regard to where or how that resource is stored — to the application, all resources are equally available and easy to use. The system reserves resource IDs in a certain range to help avoid resource conflicts arising from this. Resource Manager APIs allow the programmer to manipulate the stack and modify the search behaviour.

Editing resource forks

As the resource fork can be edited with a resource editor such as ResEdit
ResEdit
ResEdit was a developer tool application for the Apple Macintosh, used to create and edit resources directly in the Mac's resource fork architecture. It was an alternative to tools such as REdit, and the resource compiler Rez. For the average user, ResEdit was generally easier to use, because it...

, it can be used to localize
Internationalization and localization
In computing, internationalization and localization are means of adapting computer software to different languages, regional differences and technical requirements of a target market...

 and customize software. In addition, most resource editors allow visual editing of data. In Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

, it is possible to use resources when developing an application. However, if the application may need to be used in UFS
Unix File System
The Unix file system is a file system used by many Unix and Unix-like operating systems. It is also called the Berkeley Fast File System, the BSD Fast File System or FFS...

, it is also possible to configure it so that the entire resource fork is moved to the data fork, using the Raw Resource File setting. The integrated development environment
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

s distributed for free by Apple Inc., which include MPW
Macintosh Programmer's Workshop
Macintosh Programmer's Workshop or MPW, is a software development environment for the Classic Mac OS, written by Apple Computer. For Macintosh developers, it was one of the primary tools for building applications for System 7.x and Mac OS 8.x and 9.x. Initially, MPW was sold as a commercial product...

 and Apple Developer's Tools
Xcode
Xcode is a suite of tools, developed by Apple, for developing software for Mac OS X and iOS. Xcode 4.2, the latest major version, is available on the Mac App Store for free for Mac OS X 10.7 , and on the Apple Developer Connection website for free to registered developers Xcode is a suite of tools,...

, include a compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 called Rez. This uses a dedicated language, also called Rez, which can be used to create a resource fork by compiling source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

. A decompiler, DeRez, which can be used to change a resource fork back into Rez code is also included.

In the structure of the resource fork, there is a piece of data called a “resource map” which stores the positions of resource data items. This can be used to allow random access
Random access
In computer science, random access is the ability to access an element at an arbitrary position in a sequence in equal time, independent of sequence size. The position is arbitrary in the sense that it is unpredictable, thus the use of the term "random" in "random access"...

 to resource data based on the defined IDs and names. The resource fork can be thought of as consisting of essentially two objects, the resource map and the resource data itself, but in fact each data type is a hierarchical structure which stores multiple items of data. The format in which the information in the resource data is stored is defined based on the types of information, which are known as “resource types.” Resource data often makes references to other types of data.

To view the resource fork in the Terminal application. Append “/..namedfork/rsrc” to your command. e.g., take the command “ls -aol IMG_0593.jpg” then append the resource fork viewing suffix “ls -aol IMG_0593.jpg/..namedfork/rsrc” to view the ls -aol command information of the resource fork of file “IMG_0593.jpg”

How a resource fork is accessed

A resource fork is accessed via an API called the Resource Manager.
  1. When a resource fork is accessed, data including the start position and length of the resource data and resource map is read in from the header.
  2. If a resource type to read in has been specified, a check is performed to make sure that type is present in the resource list, and the number of items of data containing that type and their offsets in the resource reference list from the start position of the resource map is found.
  3. The resource ID, the offset of the resource name, the resource properties, and the offset of the data from the start position of the resource data is found.
  4. If resource data with the specified ID or name is present in the resource data, the offset obtained above is accessed, the data length is found, and all the data stored there is read in, and returned as the return value.


There are also File Manager APIs such as PBOpenRF that allow access to the raw resource fork; however, they should be used only for applications such as copying a file – Apple strongly warns against using the resource fork as a “second data fork.”
From the POSIX
POSIX
POSIX , an acronym for "Portable Operating System Interface", is a family of standards specified by the IEEE for maintaining compatibility between operating systems...

 interface, the resource fork can be accessed as filename/..namedfork/rsrc or as filename/rsrc; the shorter form has been deprecated on Mac OS X 10.4.

Data types in a resource fork

The smallest elements making up a resource fork are called data types. There are several data types. After a resource fork is accessed, its contents can be found by reading it in as appropriate for the data types defined in advance. Placing definitions inside the program stating how data is to be treated makes it possible to store resources called TMPL resources as well. Using this method increases the visibility of the data when viewed with a program such as ResEdit, making later editing simpler. As the Macintosh platform originated with Motorola-based processors (68k and PPC), the data is serialized to disk in big endian
Endianness
In computing, the term endian or endianness refers to the ordering of individually addressable sub-components within the representation of a larger data item as stored in external memory . Each sub-component in the representation has a unique degree of significance, like the place value of digits...

 format.

The following is a list of the major data types, in alphabetical order.


































Data type (actual name) Description
BBIT (binary bit)Represents a single boolean bit (true or false). Normally the number of BBITs must be a multiple of 8.
BOOL (boolean)Represents a boolean value. It consists of 2 bytes; 256 is true, and 0 is false.
CHAR (character)Represents a one-byte character.
CSTR (C string)Represents a string of the form used in the C programming language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

: a null-terminated string
Null-terminated string
In computer programming, a null-terminated string is a character string stored as an array containing the characters and terminated with a null character...

 of bytes.
DLNG (decimal long word integer)A decimal long word (4 byte) integer. Represents values between approximately −2.1 billion and 2.1 billion.
HEXD (hex dump)Indicates that the data from this position to the end is hexadecimal. This is used to represent code resources or compressed data.
HLNG (long word hexadecimal)This data is treated as a 4 byte hexadecimal value. It is used, among other things, to represent integers greater than 2.1 billion, such as unsigned long values in C.
PSTR (Pascal string)Represents a Pascal string, with the first byte giving the length of the string.
TNAM (type name)A string representing a value such as a creator code
Creator code
A creator code is a mechanism introduced in pre-Mac OS X versions of the Macintosh operating system to link a data file to the application program which created it, in a manner similar to file extensions in other operating systems. Codes are four-byte OSTypes. For example, the creator code of the...

, which is always 4 bytes long.
RECT (rectangle)Represents the coordinates of the corners of a rectangle. Always 8 bytes long.

Major resource types

Note that types must be 4 bytes long, so types like snd and STR actually have a space (0x20) at the end.







































































































Name of resource type (actual name)Description
alis (alias)Stores an alias to another file, in a resource fork of a file whose "alias" attribute bit is set
ALRT (alert)Defines the shape of an application alert box
APPL (application)Stores application information
BNDL (bundle)Defines data such as a file type icon used in an application
cicn (color icon)Defines a color icon used in data
clut (color look-up table)Defines a color palette used in data
CNTL (control)Defines the details of a component positioned in a window
CODE (code resource)Stores the machine code for the program
CURS (cursor)Defines the shape of a monochrome cursor
DITL (dialog item list)Defines a component of a window
DLOG (dialog)Defines the shape of a dialog box for an application
FREF (file reference)Defines a file type handled by an application
hfdr (icon balloon help)Defines the contents and shape of the balloon help displayed when the cursor hovers over the file in the Finder
icl8 (8 bit icon list)Defines an icon displayed in the Finder
icns (32 bit icon list)Defines an icon displayed in the Finder
ICON (icon)Defines a monochrome item used in data
kind (file description)Defines a description of a file type
MBAR (menu bar)Defines a menu and menu bar for an application
MDEF (menu definition)Defines a menu for an application. Can also be used to define menus with complex shapes such as color palettes.
MENU (menu)Defines the menu items in an application
MooV (movie)Stores a QuickTime movie
open (open)Defines a file type which the application can open
PICT (picture)Stores a PICT image contained in the file
PREF (preference)Stores the environment settings for an application
snd (sound)Stores a sound used in the file
STR (string)Stores a string or hexadecimal data used in the file
STR# (string list)Stores multiple strings used in the file
styl (style)Defines style information, such as the font, color and size of text
TEXT (text)Stores text
TMPL (template)Defines the format for the resource data
vers (version)Defines the version or region of use of the file
WDEF (window definition)Defines a window for the application. Windows of an unspecified shape can also be defined.
WIND (window)Defines the shape of an application window

Major resource editors

ResEdit
ResEdit
ResEdit was a developer tool application for the Apple Macintosh, used to create and edit resources directly in the Mac's resource fork architecture. It was an alternative to tools such as REdit, and the resource compiler Rez. For the average user, ResEdit was generally easier to use, because it...

: Distributed free of charge by Apple. Can be used for visual editing of resource data. If the structure of data is known, it can display a range of different types of data in a visual format.
Resorcerer: Expensive, but popular, as it can be used for visual editing of many more types of data than ResEdit.
HexEdit: A binary editor, which in fact is normally used more for editing the data fork rather than the resource fork.
ResKnife
ResKnife
ResKnife is an open source resource editor for the Apple Macintosh platform. It supports reading and writing resource maps to any fork and has basic template-based and hexadecimal editing functionality...

: Open‐source editor for Mac OS X
Rezycle: A Mac OS X tool that extracts resources from a resource fork into separate binary files while converting many types into formats suitable for modern development.

Compatibility problems

The complexity of programming with resource forks has led to compatibility problems when accessing other file systems via file sharing protocols such as AFP
Apple Filing Protocol
The Apple Filing Protocol is a network protocol that offers file services for Mac OS X and original Mac OS. In Mac OS X, AFP is one of several file services supported including Server Message Block , Network File System , File Transfer Protocol , and WebDAV...

, SMB
Server Message Block
In computer networking, Server Message Block , also known as Common Internet File System operates as an application-layer network protocol mainly used to provide shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network. It also provides an...

, NFS and FTP, when storing to non-HFS volumes, or when transmitting files to other systems in other ways (such as via email).
The AFP protocol natively supports Resource Forks, and so resource forks are typically transmitted to these volumes as-is, and stored by the server transparently to clients. The SMB protocol supports a file metadata system similar to Macintosh forks known as Alternate Data Streams. Mac OS X did not support storing resource forks in ADSes on SMB volumes by default until OS X 10.6. In previous versions of the OS, including upgraded versions of 10.6, this feature can be enabled with a param change or by creating a special file.

Networked file sharing protocols such as NFSv3 and FTP do not have a concept of file metadata, and so there is no way to natively store resource forks. This is also true when writing to certain types of local file systems, including UFS, and on SMB volumes where Alternate Data Stream support is not enabled. In those cases, OS X stores metadata and resource forks using a technique called AppleDouble, in which the data fork is written as one file, and the resource fork and metadata are written as an entirely separate file preceded by a “._” naming convention. For example:
ExampleFile.psd would contain the data fork, and ._ExampleFile.psd would contain the resource fork and metadata.

Compatibility problems can arise because Mac OS X will handle storage of resource forks differently, depending on OS X version, settings, and file system type. For example, on an SMB network with a mixture of 10.5 and 10.6 clients. A freshly installed 10.6 client will look for and store resource forks on an SMB volume in ADSes, but the 10.5 client will (by default) ignore ADSes and use AppleDouble format to handle forks. If a fileserver supports both AFP and NFS, then clients using NFS will store files in AppleDouble format, whereas AFP users will use AppleSingle format (resource forks are stored natively) . In those cases, compatibility can sometimes be maintained by forcing clients to use, or not use, AppleDouble format.

Many fileservers providing AFP support do not natively support resource forks on their local file systems. In those cases the forks may be stored in special ways, such as specially named files, special directories, or even Alternate Data Streams.

Another challenge is preserving resource forks when transmitting files using non-resource fork-aware applications or with certain transfer methods, including email and FTP. A number of file formats, such as MacBinary
MacBinary
Due to the metadata-rich nature of the Macintosh Hierarchical File System, transferring Mac OS files to platforms that do not support HFS can be problematic. MacBinary was developed as a means of preserving this structure without sacrificing portability. It combines the data and resource forks...

 and BinHex
BinHex
BinHex, short for "binary-to-hexadecimal", is a binary-to-text encoding system that was used on the Mac OS for sending binary files through e-mail. It is similar to Uuencode, but combined both "forks" of the Mac file system together, along with extended file information...

, have been created to handle this. Command-line system tools SplitForks and FixupResourceForks allow manual flattening and merging of resource forks. In addition, a file server seeking to present file systems to Macintosh clients must accommodate the resource fork as well as the data fork of files; UNIX
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 servers providing AFP support usually implement this with hidden directories.

Older applications written with the Carbon API have a potential issue when being ported to the current Intel Macs. While the Resource Manager and operating system know how to deserialize data correctly for common resources like “snd ” or “moov”, resources created using TMPL resources have to be byte swapped manually to ensure file interoperability between PPC and Intel-based versions of an application. (While the resource map and other implementation details are big endian, the Resource Manager by itself doesn't have any knowledge of the contents of a generic resource, and so cannot perform the byte swapping automatically.)

Until the advent of Mac OS X v10.4
Mac OS X v10.4
Mac OS X v10.4 Tiger is the fifth major release of Mac OS X, Apple's desktop and server operating system for Macintosh computers. Tiger was released to the public on 29 April 2005 for US$129.95 as the successor to Mac OS X Panther , which had been released 18 months earlier...

, the standard UNIX command line utilities in Mac OS X (such as cp and mv) did not respect resource forks. To copy files with resource forks, one had to use ditto or CpMac and MvMac.

Other operating systems

The concept of a resource manager for graphics objects, to save memory, originated in the OOZE package on the Alto in Smalltalk-76. The concept is now largely universal in all modern operating systems. However, the concept of the resource fork remains peculiar to the Macintosh. Most operating systems used a binary file containing resources, which is then “tacked onto” the end of an existing program file. This solution is used on Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 for instance, and similar solutions are used with the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

, although the resources are often left as a separate file.

Although the Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

 NTFS
NTFS
NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....

 can support forks (and so can be a file server for Mac files), the native feature providing that support, called an alternate data stream, (introduced for this very reason) has never been used extensively — certainly not as a true resource fork. However, Windows operating system features (such as the standard Summary tab in the Properties page for non-Office files) and Windows applications are using them more often now, and Microsoft was developing a next-generation file system
WinFS
WinFS is the code name for a cancelled data storage and management system project based on relational databases, developed by Microsoft and first demonstrated in 2003 as an advanced storage subsystem for the Microsoft Windows operating system, designed for persistence and management of...

 that has this sort of feature as basis.

Early versions of the BeOS
BeOS
BeOS is an operating system for personal computers which began development by Be Inc. in 1991. It was first written to run on BeBox hardware. BeOS was optimized for digital media work and was written to take advantage of modern hardware facilities such as symmetric multiprocessing by utilizing...

 implemented a database within the file system, which could be used in a manner analogous to a resource fork. Performance issues led to a change in later releases to a system of complex file system attributes. Under this system resources were handled in a fashion somewhat more analogous to the Mac.

AmigaOS
AmigaOS
AmigaOS is the default native operating system of the Amiga personal computer. It was developed first by Commodore International, and initially introduced in 1985 with the Amiga 1000...

 does not use forked files. Its executable files are internally divided into a modular structure of large pieces (hunk
Amiga Hunk
Hunk is the executable file format of tools and programs of the Amiga Operating System based on Motorola 68000 CPU and other processors of the same family....

) capable of storing code, data, and additional information. Similarly, data and project files have a chunk
Chunk (information)
A chunk is a fragment of information which is used in many multimedia formats, such as PNG, MP3 and AVI.Each chunk contains a header which indicates some parameters A chunk is a fragment of information which is used in many multimedia formats, such as PNG, MP3 and AVI.Each chunk contains a header...

 structure codified in the IFF
Interchange File Format
Interchange File Format , is a generic container file format originally introduced by the Electronic Arts company in 1985 in order to ease transfer of data between software produced by different companies....

 standard. Other file types are stored similarly to other operating systems. Though not strictly a resource fork, AmigaOS
AmigaOS
AmigaOS is the default native operating system of the Amiga personal computer. It was developed first by Commodore International, and initially introduced in 1985 with the Amiga 1000...

 stores meta data in files known as .info files. .info files can be identified by the .info extension; for example, if you save a project to a disk, two files will be saved, MyProject and MyProject.info. MyProject would be the actual project data and MyProject.info would contain the project icon, information regarding which program is needed to open the project (since there is no application binding in AmigaOS), special project options and any user comments. .info files are invisible on the Amiga's desktop (Workbench
Workbench (AmigaOS)
-Overview:Commodore named their Amiga computer's first operating system Workbench 1.0 and continued with the Workbench name until version 3.1, when it was changed to AmigaOS, prompted by Apple renaming their propriety OS from "System" to "MacOS"...

). The icon on the desktop, taken from the .info itself, is the interface metaphor
Interface metaphor
An Interface metaphor is a set of user interface visuals, actions and procedures that exploit specific knowledge that users already have of other domains. The purpose of the interface metaphor is to give the user instantaneous knowledge about how to interact with the user interface...

 through which the user interacts both with the project itself and its associated .info file. A dialog box accessible by right-clicking the icon allows the user to see and modify the metadata present in the .info file. .info files can be seen as individual files in the Command line interface or a File manager
File manager
A file manager or file browser is a computer program that provides a user interface to work with file systems. The most common operations performed on files or groups of files are: create, open, edit, view, print, play, rename, move, copy, delete, search/find, and modify file attributes, properties...

. Modern AmigaOS clones (AROS
Aros
Aros may refer to:*Aros , a river in J. R. R. Tolkien's Middle-earth legendarium*AROS Research Operating System, a free software implementation of AmigaOS* Aros, the original Viking name of Aarhus, the second largest city in Denmark...

, MorphOS
MorphOS
MorphOS is an Amiga-compatible computer operating system. It is a mixed proprietary and open source OS produced for the Pegasos PowerPC processor based computer, PowerUP accelerator equipped Amiga computers, and a series of Freescale development boards that use the Genesi firmware, including the...

 and AOS4) inherit the structure (complete with metadata) of the .info files of older AmigaOS versions, and can also accept standard PNG graphic files as icon bitmaps in their .info files.

NeXT
NeXT
Next, Inc. was an American computer company headquartered in Redwood City, California, that developed and manufactured a series of computer workstations intended for the higher education and business markets...

 operating systems NeXTSTEP
NEXTSTEP
NeXTSTEP was the object-oriented, multitasking operating system developed by NeXT Computer to run on its range of proprietary workstation computers, such as the NeXTcube...

 and OPENSTEP
OpenStep
OpenStep was an object-oriented application programming interface specification for an object-oriented operating system that used a non-NeXTSTEP operating system as its core, principally developed by NeXT with Sun Microsystems. OPENSTEP was a specific implementation of the OpenStep API developed...

, and its successor, Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

, and other systems like RISC OS
RISC OS
RISC OS is a computer operating system originally developed by Acorn Computers Ltd in Cambridge, England for their range of desktop computers, based on their own ARM architecture. First released in 1987, under the name Arthur, the subsequent iteration was renamed as in 1988...

 implemented another solution. Under these systems the resources are left in an original format, for instance, pictures are included as complete TIFF files instead of being encoded into some sort of container. These resources are then placed in a directory along with the executable code and “raw data”. The directory (called a “bundle
Bundle (NEXTSTEP)
In NEXTSTEP, OPENSTEP, their lineal descendants Mac OS X, iOS, and in GNUstep, a bundle is a directory that allows related resources such as an application's executable and its graphics to be grouped together, appearing as a single file to the user....

” or “application directory
Application directory
An application directory is a grouping of software code, help files and resources that together comprise a complete software package but are presented to the user as a single object....

”) is then presented to the user as the application itself. This solution provides all of the same functionality as the resource fork, but allows the resources to be easily manipulated by any application – a “resource editor” (like ResEdit
ResEdit
ResEdit was a developer tool application for the Apple Macintosh, used to create and edit resources directly in the Mac's resource fork architecture. It was an alternative to tools such as REdit, and the resource compiler Rez. For the average user, ResEdit was generally easier to use, because it...

) is not needed. From the command line interface, the bundle appears to be a normal directory. This approach was not an option on the original Mac OS
Mac OS history
On January 24, 1984, Apple Computer Inc. introduced the Macintosh personal computer, with the Macintosh 128K model, which came bundled with what was later renamed the Mac OS, but then known simply as the System Software....

, since the file system (MFS
Macintosh File System
Macintosh File System is a volume format created by Apple Computer for storing files on 400K floppy disks. MFS was introduced with the Macintosh 128K in January 1984....

) did not support folders/directories. Mac OS X does retain the classic Resource Manager API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 as part of its Carbon libraries for backward compatibility. However, the resources themselves can now be stored in separate data files within the file system — the Resource Manager now hides this implementation change from the client code.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK