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


OpenWD

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

FUNCTION OpenWD (vRefNum: Integer; dirID: LongInt; 
                  procID: LongInt; VAR wdRefNum: Integer): OSErr;
vRefNum
A volume reference number, a working directory reference number, or 0 for the default volume.
dirID
A directory ID.
procID
A working directory user identifier. You should use your application's signature as the user identifier.
wdRefNum
On exit, the working directory reference number.
DESCRIPTION
The OpenWD function creates a working directory that corresponds to the specified directory. It returns in wdRefNum 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 wdRefNum. 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 dirID parameter is the volume's root directory, no working directory is created; instead, the volume reference number is returned in the wdRefNum parameter.

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 to the file

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996