article

OSType (also known as FourCC or ResType) is the name of a four-byte type commonly used as an identifier in Mac OS. The four bytes could in principle have any binary value, though they are usually ASCII or characters from the Mac OS Roman character set.

OSType values were used to identify file data format types, as well as 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 was easy to reassign the ownership of any of these documents to any supporting application, without changing its name or otherwise affecting its contents.

OSTypes were also used to identify the types of data in other places besides files: for instance, on the Clipboard or in resources, as well as in AppleEvents. They tended to have common meanings across these uses: for instance, 'TEXT' meant a block of text (encoding unspecified, but usually ASCII or Mac Roman), while 'PICT' meant 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 more easy 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.

Other uses for OSTypes were:

  • 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 table IDs in the TrueType font format
  • 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.

Other platforms


Similar four character codes are used to identify data types in many other operating systems and applications. These codes are generally referred to as FourCCs rather than OSTypes.

Apple software

OSType

 

This article is licensed under the GNU Free Documentation License. It uses material from the "OSType".

Home Pageartsbusinesscomputersgameshealthhospitalshomekids & teensnewsphysiciansrecreationreferenceregionalscienceshoppingsocietysportsworld