How A Resource Fork Is Accessed
Resource forks appear as the extended attribute com.apple.ResourceFork.
Previously resource forks were accessed via the 'Resource Manager' API. This API is now deprecated.
Under the deprecated API:
- When a resource fork is accessed, data including the start position and length of the resource data and resource map is read in from the header.
- If a resource type to read in has been specified, a check is performed to make sure that type is present in the resource list, and the number of items of data containing that type and their offsets in the resource reference list from the start position of the resource map is found.
- The resource ID, the offset of the resource name, the resource properties, and the offset of the data from the start position of the resource data is found.
- If resource data with the specified ID or name is present in the resource data, the offset obtained above is accessed, the data length is found, and all the data stored there is read in, and returned as the return value.
File Manager APIs such as PBOpenRF
also allowed access to the raw resource fork; however, they should be used only for applications such as copying a file – Apple strongly warns against using the resource fork as a “second data fork.”
From the POSIX interface, the resource fork could be accessed as filename/..namedfork/rsrc
or as filename/rsrc
; the shorter form was deprecated in OS X 10.4 and removed completely in MacOS X 10.7.
Read more about this topic: Resource Fork
Famous quotes containing the words resource and/or fork:
“Helping children at a level of genuine intellectual inquiry takes imagination on the part of the adult. Even more, it takes the courage to become a resource in unfamiliar areas of knowledge and in ones for which one has no taste. But parents, no less than teachers, must respect a childs mind and not exploit it for their own vanity or ambition, or to soothe their own anxiety.”
—Dorothy H. Cohen (20th century)
“Every country we conquer feeds us. And these are just a few of the good things well have when this war is over.... Slaves working for us everywhere while we sit back with a fork in our hands and a whip on our knees.”
—Curtis Siodmak (19021988)