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
Low-Level HFS Routines / Maintaining Working Directories


PBOpenWD

You can use the PBOpenWD function to create a working directory.

FUNCTION PBOpenWD (paramBlock: WDPBPtr; async: Boolean): OSErr;
paramBlock
A pointer to a working directory 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.
-->ioNamePtr StringPtrA pointer to a pathname.
<->ioVRefNumIntegerA volume specification.
-->ioWDProcIDLongIntThe working directory user identifier.
-->ioWDDirIDLongIntThe working directory's directory ID.

DESCRIPTION
The PBOpenWD function creates a working directory that corresponds to the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID. (You can also specify the directory using a combination of partial pathname and directory ID.) PBOpenWD returns in ioVRefNum a working directory reference number that can be used in subsequent File Manager calls.

If a working directory having the specified user identifier already exists for the specified directory, no new working directory is opened; instead, the existing working directory reference number is returned in ioVRefNum. If the specified directory already has a working directory with a different user identifier, a new working directory reference number is returned.

If the directory specified by the ioWDDirID parameter is the volume's root directory, no working directory is created; instead, the volume reference number is returned in the ioVRefNum parameter.

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

RESULT CODES
noErr0No error
nsvErr-35No such volume
fnfErr-43No such directory
tmwdoErr-121Too many working directories open
afpAccessDenied-5000User does not have the correct access

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996