Important: The information in this document is obsolete and should not be used for new development.
PBOpenWD
You can use thePBOpenWD
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.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. --> ioNamePtr
StringPtr
A pointer to a pathname. <-> ioVRefNum
Integer
A volume specification. --> ioWDProcID
LongInt
The working directory user identifier. --> ioWDDirID
LongInt
The working directory's directory ID. DESCRIPTION
ThePBOpenWD
function 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.)PBOpenWD
returns inioVRefNum
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 theioVRefNum
parameter.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector forPBOpenWD
are
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