Resource Fork - Data Types in A Resource Fork

Data Types in A Resource Fork

The smallest elements making up a resource fork are called data types. There are several data types. After a resource fork is accessed, its contents can be found by reading it in as appropriate for the data types defined in advance. Placing definitions inside the program stating how data is to be treated makes it possible to store resources called TMPL resources as well. Using this method increases the visibility of the data when viewed with a program such as ResEdit, making later editing simpler. As the Macintosh platform originated with Motorola-based processors (68k and PPC), the data is serialized to disk in big endian format.

The following is a list of the major data types, in alphabetical order.

Data type (actual name) Description
BBIT (binary bit) Represents a single boolean bit (true or false). Normally the number of BBITs must be a multiple of 8.
BOOL (boolean) Represents a boolean value. It consists of 2 bytes; 256 is true, and 0 is false.
CHAR (character) Represents a one-byte character.
CSTR (C string) Represents a string of the form used in the C programming language: a null-terminated string of bytes.
DLNG (decimal long word integer) A decimal long word (4 byte) integer. Represents values between approximately −2.1 billion and 2.1 billion.
HEXD (hex dump) Indicates that the data from this position to the end is hexadecimal. This is used to represent code resources or compressed data.
HLNG (long word hexadecimal) This data is treated as a 4 byte hexadecimal value. It is used, among other things, to represent integers greater than 2.1 billion, such as unsigned long values in C.
PSTR (Pascal string) Represents a Pascal string, with the first byte giving the length of the string.
TNAM (type name) A string representing a value such as a creator code, which is always 4 bytes long.
RECT (rectangle) Represents the coordinates of the corners of a rectangle. Always 8 bytes long.

Read more about this topic:  Resource Fork

Famous quotes containing the words data, types, resource and/or fork:

    This city is neither a jungle nor the moon.... In long shot: a cosmic smudge, a conglomerate of bleeding energies. Close up, it is a fairly legible printed circuit, a transistorized labyrinth of beastly tracks, a data bank for asthmatic voice-prints.
    Susan Sontag (b. 1933)

    Science is intimately integrated with the whole social structure and cultural tradition. They mutually support one other—only in certain types of society can science flourish, and conversely without a continuous and healthy development and application of science such a society cannot function properly.
    Talcott Parsons (1902–1979)

    No, Ernest, don’t talk about action.... It is the last resource of those who know not how to dream.
    Oscar Wilde (1854–1900)

    Wherever a man separates from the multitude, and goes his own way in this mood, there indeed is a fork in the road, though ordinary travelers may see only a gap in the paling. His solitary path across lots will turn out the higher way of the two.
    Henry David Thoreau (1817–1862)