OSType

OSType (also known as ResType) is the name of a four-byte sequence commonly used as an identifier in the classic Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those used 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 possible 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 Panther, 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 many codes from the OSType. A similar system is also used in TrueType font format.

## See also

* Magic number
* Interchange File Format
* Uniform Type Identifier macOS's replacement for OSType based identifiers.
* FourCC, the corresponding concept on Microsoft Windows

* v
* t
* e

Classic Mac OS

Versions|

* System 1
* System 2, 3, and 4
* System 5
* System 6
* System 7
* Mac OS 7
* Mac OS 8
* Mac OS 9

Applications|

* Calculator
* Chooser
* Drive Setup
* DVD Player
* Finder
* Graphing Calculator
* Keychain Access
* PictureViewer
* PowerTalk
* QuickTime Player
* Network Browser
* Scrapbook
* Sherlock
* Software Update
* Stickies
* System Information
* SimpleText

Developer|

* HyperCard
* MacsBug
* Macintosh Programmer's Workshop
* ResEdit

Technology|

* Alias
* Appearance Manager
* Apple menu
* At Ease
* Balloon help
* Bomb error
* Command key (⌘)
* Control Panel
* Control Strip
* Creator code
* Dogcow
* Extensions
* Hierarchical File System
* HFS Plus
* Keychain
* Labels
* Macintosh File System
* Macintosh Toolbox
* Managers
* Menu blinking
* MultiFinder
* Option key (⌥)
* OSType
* PICT
* QuickDraw
* QuickTime
* Resource fork
* Sosumi sound
* Startup sequence
* System folder
* System suitcase
* Type code
* WorldScript

Related articles|

* Memory management
* Old World ROM
* New World ROM
* Software

0.00

(0 votes)

|

Retrieved from "https://handwiki.org/wiki/index.php?title=OSType&oldid=228930"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template