Important: The information in this document is obsolete and should not be used for new development.
Opening Resource Forks
To 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.The
FSpOpenResFile,HOpenResFile,OpenRFPerm, andOpenResFilefunctions all open resource forks. Use theFSpOpenResFilefunction to open a resource fork using a file system specification (FSSpec) record. You can determine whetherFSpOpenResFileis available by calling theGestaltfunction with thegestaltFSAttrselector code.If
FSpOpenResFileis not available, you can useHOpenResFile,OpenRFPerm, orOpenResFileto open a resource fork. TheHOpenResFilefunction allows you to specify both a directory ID and a volume reference number, and is therefore preferred ifFSpOpenResFileis not available. TheOpenRFPermandOpenResFilefunctions are earlier versions ofHOpenResFilethat are still supported but are more restricted in their capabilities.
Subtopics
- FSpOpenResFile
- HOpenResFile
- OpenRFPerm
- OpenResFile