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:

    Mental health data from the 1950’s on middle-aged women showed them to be a particularly distressed group, vulnerable to depression and feelings of uselessness. This isn’t surprising. If society tells you that your main role is to be attractive to men and you are getting crow’s feet, and to be a mother to children and yours are leaving home, no wonder you are distressed.
    Grace Baruch (20th century)

    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)

    In a world which furnishes so many employments which are useful, and so many which are amusing, it is our own fault if we ever know what ennui [boredom] is, or if we are ever driven to the miserable resource of gaming, which corrupts our dispositions, and teaches us a habit of hostility against all mankind.
    Thomas Jefferson (1743–1826)

    Eye of newt and toe of frog,
    Wool of bat and tongue of dog,
    Adder’s fork and blind-worm’s sting,
    Lizard’s leg and owlet’s wing,
    For a charm of powerful trouble,
    Like a hell-broth boil and bubble.
    William Shakespeare (1564–1616)