PBHOpenRF
You can use the PBHOpenRF function to open the resource fork of file.
FUNCTION PBHOpenRF (paramBlock: HParmBlkPtr; async: Boolean):
OSErr;
paramBlock
- A pointer to a basic HFS parameter block.
async
- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
| --> | ioCompletion | ProcPtr | A pointer to a completion routine. |
| <-- | ioResult | OSErr | The result code of the function. |
| --> | ioNamePtr | StringPtr | A pointer to a pathname. |
| --> | ioVRefNum | Integer | A volume specification. |
| <-- | ioRefNum | Integer | A file reference number. |
| --> | ioPermssn | SignedByte | The read/write permission. |
| --> | ioDirID | LongInt | A directory ID. |
DESCRIPTION
The PBHOpenRF function creates an access path to the resource fork of a file and returns a file reference number in the ioRefNum field.
SPECIAL CONSIDERATIONS
Generally your application should use Resource Manager routines rather than File Manager routines to access a file's resource fork. The PBHOpenRF function does not read the resource map into memory and is generally useful only for applications (such as utilities that copy files) that need block-level access to a resource fork. In particular, you should not use the resource fork of a file to hold nonresource data. Many parts of the system software assume that a resource fork always contains resource data.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBHOpenRF is _HOpenRF.
RESULT CODES
| noErr | 0 | No error |
| nsvErr | -35 | No such volume |
| ioErr | -36 | I/O error |
| bdNamErr | -37 | Bad filename |
| tmfoErr | -42 | Too many files open |
| fnfErr | -43 | File not found |
| opWrErr | -49 | File already open for writing |
| permErr | -54 | Attempt to open locked file for writing |
| dirNFErr | -120 | Directory not found or incomplete pathname |
| afpAccessDenied | -5000 | User does not have the correct access to the file |