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 / Controlling Directory Access


PBHSetDirAccess

You can use the PBHSetDirAccess function to change the access control information for a directory.

FUNCTION PBHSetDirAccess (paramBlock: HParmBlkPtr; 
                           async: Boolean): OSErr;
paramBlock
A pointer to an 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.
-->ioACOwnerIDLongIntThe owner ID.
-->ioACGroupIDLongIntThe group ID.
-->ioACAccessLongIntThe access rights.
-->ioDirIDLongIntThe directory ID.

DESCRIPTION
The PBHSetDirAccess function allows you to change the access rights to the specified directory. The ioACAccess field contains the directory's access rights. You cannot set the owner or user rights bits of the ioACAccess field directly (if you try to do this, PBHSetDirAccess returns the result code paramErr). See "Directory Access Privileges," beginning on page 2-18, for a description of the ioACAccess field.

To change the owner or group, you should set the ioACOwnerID or ioACGroupID field to the appropriate ID. You must be the owner of the directory to change the owner or group ID. A guest on a server can manipulate the privileges of any directory owned by the guest.

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

RESULT CODES
noErr0No error
fnfErr-43Directory not found
vLckdErr-46Volume is locked or read-only
paramErr-50Parameter error
afpAccessDenied-5000User does not have the correct access to the directory
afpObjectTypeErr-5025Object is a file, not a directory

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996