PBOpenRFSync
PBOpenRF Open the resource fork of a file
#include <Files.h> File Manager (PBxxx)
OSErr PBOpenRF(pb, async );
ParmBlkPtr pb ; address of a 50-byte IOParam structure
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PBOpenRF opens the resource fork of a file, enabling I/O operations. As
with OpenRF, this is normally used only in file copy operations.
pb is the address of a 50-byte IOParam structure. The following fields
are relevant:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
-> ioNamePtr StringPtr 4 18 Address of full or partial path/ filename
-> ioVRefNum short 2 22 Volume or working directory ref; 0= default
-> ioVersNum SignedByte 1 26 Version (best to use 0, must use 0 on HFS)
-> ioPermssn SignedByte 1 27 File Permission (1=read, 2=write, et.al)
-> ioMisc Ptr 4 28 Address of 522-byte buffer (0=use volume buf)
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
<- ioRefNum short 2 24 Receives file reference number
async is a Boolean value. Use FALSE for normal (synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Bad name
extFSErr (-58) External file system
fnfErr (-43) File not found
ioErr (-36) I/O error
nsvErr (-35) No such volume
opWrErr (-49) File already open for writing
permErr (-54) Attempt to open locked file
tmfoErr (-42) Too many files open

Notes: Use PBOpenRF (or PBHOpenRF or OpenRF) if you wish to treat the
resource fork of the file as if it were unformatted data. The only legitimate
use for this call is in file-copying operations. See OpenRF for an example
program which duplicates both forks of a file.
See PBOpen for particulars of the parameter block field usage.