Important: The information in this document is obsolete and should not be used for new development.
PBOpenWD
You can use thePBOpenWDfunction 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. --> ioNamePtrStringPtrA pointer to a pathname. <-> ioVRefNumIntegerA volume specification. --> ioWDProcIDLongIntThe working directory user identifier. --> ioWDDirIDLongIntThe working directory's directory ID. DESCRIPTION
ThePBOpenWDfunction creates a working directory that corresponds to the directory specified byioVRefNum,ioWDDirID, andioWDProcID. (You can also specify the directory using a combination of partial pathname and directory ID.)PBOpenWDreturns inioVRefNuma 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
ioWDDirIDparameter is the volume's root directory, no working directory is created; instead, the volume reference number is returned in theioVRefNumparameter.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forPBOpenWDare
Trap macro Selector _HFSDispatch $0001 RESULT CODES
noErr 0 No error nsvErr -35 No such volume fnfErr -43 No such directory tmwdoErr -121 Too many working directories open afpAccessDenied -5000 User does not have the correct access