Important: The information in this document is obsolete and should not be used for new development.
FSpOpenDF
You can use theFSpOpenDF
function to open a file's data fork.
FUNCTION FSpOpenDF (spec: FSSpec; permission: SignedByte; VAR refNum: Integer): OSErr;
spec
- An
FSSpec
record specifying the file whose data fork is to be opened.permission
- A constant indicating the desired file access permissions.
refNum
- A reference number of an access path to the file's data fork.
DESCRIPTION
TheFSpOpenDF
function opens the data fork of the file specified by thespec
parameter and returns a file reference number in therefNum
parameter. You can pass that reference number as a parameter to any of the low- or high-level file access routines.The
permission
parameter specifies the kind of access permission mode you want. You can specify one of these constants:
CONST fsCurPerm = 0; {whatever permission is allowed} fsRdPerm = 1; {read permission} fsWrPerm = 2; {write permission} fsRdWrPerm = 3; {exclusive read/write permission} fsRdWrShPerm = 4; {shared read/write permission}In most cases, you can simply set the permission parameter tofsCurPerm
. Some applications requestfsRdWrPerm
, to ensure that they can both read from and write to a file.RESULT CODES