World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0000992656
Reproduction Date:

Title: OSType  
Author: World Heritage Encyclopedia
Language: English
Subject: Mac OS, Type code, Creator code, Apple Icon Image format, Resource fork
Collection: Apple Inc. Software, Mac Os, Metadata
Publisher: World Heritage Encyclopedia


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 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 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. A similar system is also used in TrueType font format.

See also

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.