Important: The information in this document is obsolete and should not be used for new development.
HOpen
You can use theHOpenfunction to open the data fork of a file. BecauseHOpenalso opens devices, it's safer to use theHOpenDFfunction instead.
FUNCTION HOpen (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
TheHOpenfunction creates an access path to the data fork of the specified file. A file reference number for that file is returned in therefNumparameter.
- WARNING
- If you use
HOpento try to open a file whose name begins with a period, you might mistakenly open a driver instead; subsequent attempts to write data might corrupt data on the target device. To avoid these problems, you should always useHOpenDFinstead ofHOpen.![]()
RESULT CODES