Opening Resource ForksTo open a resource fork, the Resource Manager calls the appropriate File Manager routine and returns the file reference number that it gets from the File Manager. If the file reference number returned is greater than 0, you can use this number to refer to the resource fork in some other Resource Manager routines.
OpenResFilefunctions all open resource forks. Use the
FSpOpenResFilefunction to open a resource fork using a file system specification (
FSSpec) record. You can determine whether
FSpOpenResFileis available by calling the
Gestaltfunction with the
FSpOpenResFileis not available, you can use
OpenResFileto open a resource fork. The
HOpenResFilefunction allows you to specify both a directory ID and a volume reference number, and is therefore preferred if
FSpOpenResFileis not available. The
OpenResFilefunctions are earlier versions of
HOpenResFilethat are still supported but are more restricted in their capabilities.