PBHOpenRFDenySync
PBHOpenRFDeny Open a resource fork to users with permissions levels
#include <Files.h> File Manager (PBxxx)
OSErr PBHOpenRFDeny(pb, async ); Boolean async ; 0=await completion; 1=immediate return 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
-> 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.
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.