PBHOpenRFDenySync
PBHOpenRFDeny Open a resource fork to users with permissions levels
#include <Files.h> File Manager (PBxxx)
OSErr PBHOpenRFDeny(pb, async );
HParmBlkPtr pb ; address of a 48-byte AccessParam structure
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PBHOpenRFDeny lets you restrict access to a file's resource fork to users
with a particular set of access privileges.
pb is the address of a 48-byte AccessParam structure. The following
fields are relevant:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
-> ioNamePtr ProcPtr 4 18 Pathname's address
-> ioVRefNum short 2 22 Volume reference
<- ioRefNum short 2 24 File identifier
-> ioDenyModes short 2 26 Permissions information
-> ioDirID long 4 48 Directory ID
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
nsvErr (-35) No such volume
fnfErr (-43) Input points to nonexistent file
permErr (-54) Insufficient permission level to access already opened file
opWrErr (-49) Asked for a second write permission to the same open file
accessDenied (-5000) User has incorrect access level to read or write to a file

Notes: The PBHOpenRFDeny routine lets you limit read/write access to a file's
resource fork to users with specified access rights. The ioDenyModes field
holds an integer keyed with the user's access rights data. A diagram of the
ioDenyModes format can be found in the description of the AccessParam
structure.