Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 2 - File Manager / File Manager Reference
Shared Environment Routines / Opening Files While Denying Access


PBHOpenDeny

You can use the PBHOpenDeny function to open a file's data fork using the access
deny modes.

FUNCTION PBHOpenDeny (paramBlock: HParmBlkPtr; async: Boolean): 
                        OSErr;
paramBlock
A pointer to a basic HFS parameter block.
async
A Boolean value that specifies asynchronous (TRUE) or synchronous (FALSE) execution.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe result code of the function.
-->ioNamePtrStringPtrA pointer to a pathname.
-->ioVRefNumIntegerA volume specification.
<--ioRefNumIntegerThe file reference number.
-->ioDenyModesIntegerAccess rights data.
-->ioDirIDLongIntThe directory ID.

DESCRIPTION
The PBHOpenDeny function opens a file's data fork with specific access rights specified in the ioDenyModes field. The file reference number is returned in ioRefNum.

The result code opWrErr is returned if you've requested write permission and you
have already opened the file for writing; in that case, the existing file reference
number is returned in ioRefNum. You should not use this reference number unless
your application originally opened the file.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for PBHOpenDeny are
Trap macroSelector
_HFSDispatch$0038

RESULT CODES
noErr0No error
tmfoErr-42Too many files open
fnfErr-43File not found
fLckdErr-45File is locked
vLckdErr-46Volume is locked or read-only
opWrErr-49File already open for writing
paramErr-50Function not supported by volume
permErr -54File is already open and cannot be opened using specified deny modes
afpAccessDenied-5000User does not have the correct access to the file
afpDenyConflict-5006Requested access permission not possible

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996