OSType

OSType

OSType (also known as ResType) 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 format types and the applications that created them. The separation of file types and creators allowed the coexistence of documents of the same format belonging to different applications; it is easy to reassign the ownership of any of these documents to any supporting application without changing its name or otherwise affecting its contents.

Macintosh file systems have a separate area for metadata distinct from either the data or resource fork. The catalogue entry for each file stores just the creation and modification timestamp, the file type code (one OSType) and creator code (another OSType), fork length, and the file name.

The resource fork of a file in a Macintosh file system stores an OSType identifier with each resource.

OSTypes are also used to identify the type of data in places other than files: for instance, on the Clipboard, or in AppleEvents. They tend to have common meanings across these uses: for instance, 'TEXT' identifies a block of text (encoding unspecified, but usually ASCII or Mac Roman), while 'PICT' indicates a QuickDraw picture.

Four byte identifiers are useful because they can be made up of four human-readable characters with mnemonic qualities, while still fitting in the four byte memory space typically allocated for integers in 32-bit systems. From a memory management standpoint, they're easier to handle than, for example, character strings of variable length. Compared to arbitrary 32-bit integer values, they are unambiguous since the byte-order is clearly defined. In programming, an OSType made of human-readable characters can be conveniently specified as a C multi-character literal, which allows you to specify an integer literal, whose bytes are made up of human-readable characters.

Since Mac OS X 10.3, OSType signatures are one of several sources that may be examined to determine a Uniform Type Identifier and are no longer used as the primary data type signature.

Other uses for OSTypes include:

  • as Gestalt selector codes
  • as record field IDs and event type and class IDs in AppleEvents
  • for identifying components in the Component Manager
  • as "atom" IDs in the QuickTime movie and image file formats
  • as a localization-independent way of identifying standard folders in the Folder Manager
  • in QuickDraw GX, they were used as gxTag types and also as types of collection items in the Collection Manager.
  • as error codes in certain libraries, such as QuickTime

FourCC is a system of data format identification used in some platform-independent multimedia containers, such as AIFF and RIFF. It inherits may codes from the OSType. Similar system is also used in TrueType font format.

See also


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Apple events — are the canonical message based interprocess communication mechanism in Mac OS, first appearing in System 7 and supported by every version since then, including Mac OS X. Apple events describe high level events such as open document or print file …   Wikipedia

  • 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… …   Wikipedia

  • FourCC — A FourCC (literally, four character code) is a sequence of four bytes used to uniquely identify data formats. The concept originated in the OSType scheme used in the Macintosh system software and was adopted for the Amiga/Electronic Arts… …   Wikipedia

  • Reverse-DNS — The reverse domain name system (reverse DNS), sometimes confused with Reverse DNS lookup or Reverse domain hijacking, is a system for naming components, packages, or types in computer systems. A characteristic of reverse DNS strings is that they… …   Wikipedia

  • File format — A file format is a particular way that information is encoded for storage in a computer file. Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice …   Wikipedia

  • Mac OS — MacOS redirects here. For the American humanities teaching program, see Man: A Course of Study. Mac OS Company / developer Apple OS family Mac OS (System 1–7, Mac OS 8–9) …   Wikipedia

  • QuickTime — (Classic) …   Wikipedia

  • Interchange File Format — (IFF), is a generic file format originally introduced by the Electronic Arts company in 1985 (in cooperation with Commodore Amiga) in order to ease transfer of data between software produced by different companies. IFF files do not have any… …   Wikipedia

  • Audio Interchange File Format — Infobox file format name = Audio Interchange File Format icon = extension = .aiff .aif .aifc mime = audio/x aiff audio/aiff type code = AIFF uniform type = public.aiff audio public.aifc audio owner = Apple Inc. genre = audio file container for =… …   Wikipedia

  • 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. For example, the type… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”