Creator code
Encyclopedia
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 OSType
s. For example, the creator code of the HyperCard
application and its associated "stacks" is WILD. This allows the application to launch and open a file whenever any of its associated files is double-clicked.
The binding are stored inside the resource fork
as BNDL and fref resources. These resources maintained the creator code as well as the association with each type code
and icon
.
Creator codes could contain numbers and some special characters. Occasionally they represented inside jokes. For instance, the Marathon
computer game had a creator code of 26.2 (the approximate length, in miles, of a marathon
) and Marathon 2: Durandal
had a creator code of 52.4.
The key difference between extensions and Apple's system is that file type and file ownership bindings are kept fully distinct. This allows files to be written of the same type - TEXT say - by different applications, and freely opened by any application that can read TEXT files, but when double-clicked, will open the original application that created it. With the extensions approach, this distinction is lost - all files with a .txt extension will be mapped to a single text editing application.
Mac OS X retains creator codes, but supports extensions as well (However, beginning with OS X 10.6 Snow Leopard, creator codes are ignored by the Operating System.). Creator codes have been internally superseded by Apple's Uniform Type Identifier
scheme, which manages application and file type identification as well as type codes, creator codes and file extensions.
Apple's developer documentation states that applications should continue to set type codes and optionally set creator codes. If either already exists, applications should preserve them. Furthermore, creator codes are used in document binding prior to the file extension alone.
Creator codes are not readily accessible for users to manipulate, although they can be viewed and changed with certain software, most notably the Mac OS X command line tools GetFileInfo and SetFile which are installed as part of the developer tools into /Developer/Tools.
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...
versions of the Macintosh 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...
to link a data file to the application program
Computer software
Computer software, or just software, is a collection of computer programs and related data that provide the instructions for telling a computer what to do and how to do it....
which created it, in a manner similar to file extensions in other operating systems. Codes are four-byte 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...
s. For example, the creator code of the HyperCard
HyperCard
HyperCard is an application program created by Bill Atkinson for Apple Computer, Inc. that was among the first successful hypermedia systems before the World Wide Web. It combines database capabilities with a graphical, flexible, user-modifiable interface. HyperCard also features HyperTalk, written...
application and its associated "stacks" is WILD. This allows the application to launch and open a file whenever any of its associated files is double-clicked.
The binding are stored inside the resource fork
Resource fork
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...
as BNDL and fref resources. These resources maintained the creator code as well as the association with each type code
Type code
A type code is the only mechanism used in pre-Mac OS X versions of the Macintosh operating system to denote a file's format, in a manner similar to file extensions in other operating systems. Codes are four-byte OSTypes...
and icon
Icon (computing)
A computer icon is a pictogram displayed on a computer screen and used to navigate a computer system or mobile device. The icon itself is a small picture or symbol serving as a quick, intuitive representation of a software tool, function or a data file accessible on the system. It functions as an...
.
Creator codes could contain numbers and some special characters. Occasionally they represented inside jokes. For instance, the Marathon
Marathon (video game)
Marathon is a first-person shooter video game with a science fiction theme developed and published by Bungie released in December 1994 for the Apple Macintosh. The game was Bungie's second foray into the emerging genre of games with a first-person perspective, the first being Pathways into...
computer game had a creator code of 26.2 (the approximate length, in miles, of a marathon
Marathon
The marathon is a long-distance running event with an official distance of 42.195 kilometres , that is usually run as a road race...
) and Marathon 2: Durandal
Marathon 2: Durandal
Marathon 2: Durandal is the first sequel in the Marathon series of science fiction first-person shooter computer games from Bungie Software. It was released on November 24, 1995. The game is mostly set on the fictional planet of Lh'owon, homeworld of the S'pht, and once again the player takes the...
had a creator code of 52.4.
The key difference between extensions and Apple's system is that file type and file ownership bindings are kept fully distinct. This allows files to be written of the same type - TEXT say - by different applications, and freely opened by any application that can read TEXT files, but when double-clicked, will open the original application that created it. With the extensions approach, this distinction is lost - all files with a .txt extension will be mapped to a single text editing application.
Mac OS X retains creator codes, but supports extensions as well (However, beginning with OS X 10.6 Snow Leopard, creator codes are ignored by the Operating System.). Creator codes have been internally superseded by Apple's Uniform Type Identifier
Uniform Type Identifier
A Uniform Type Identifier is a text string used on software provided by Apple Inc. to uniquely identify a given class or type of item...
scheme, which manages application and file type identification as well as type codes, creator codes and file extensions.
Apple's developer documentation states that applications should continue to set type codes and optionally set creator codes. If either already exists, applications should preserve them. Furthermore, creator codes are used in document binding prior to the file extension alone.
Creator codes are not readily accessible for users to manipulate, although they can be viewed and changed with certain software, most notably the Mac OS X command line tools GetFileInfo and SetFile which are installed as part of the developer tools into /Developer/Tools.
External links
- The Type/Creator Database Website
- Apple's web page for reserving Creator codes (so that every application gets a unique code)
- How application binding policy changed in Snow Leopard