HOpenDF
You can use the HOpenDF function to open the data fork of a file.
FUNCTION HOpenDF (vRefNum: Integer; dirID: LongInt;
fileName: Str255; permission: SignedByte;
VAR refNum: Integer): OSErr;
vRefNum
- A volume reference number, a working directory reference number, or 0 for the default volume.
dirID
- A directory ID.
fileName
- The name of the file.
permission
- The access mode under which to open the file.
refNum
- The file reference number of the opened file.
DESCRIPTION
The HOpenDF function creates an access path to the data fork of a file and returns, in
the refNum parameter, an access path reference number to that fork. You can pass that reference number as a parameter to any of the high-level file access routines.
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 |