PBCloseWDSync
PBCloseWD Release working directory
#include <Files.h> File Manager (PBxxx)
OSErr PBCloseWD(pb, async );
WDPBPtr pb ; address of a 52-byte WDPBRec structure
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PBCloseWD dissolves a specified working directory control block, releasing
its storage. Since the area for such control blocks is finite, you should close
any that you don't need.
pb is the address of a 52-byte WDPBRec structure (or any other
structure) with the following fields:
Out-In Name Type Size Offset Description
-> ioCompletion ProcPtr 4 12 Completion routine address (if async =TRUE)
<-> ioVRefNum short 2 22 Working directory reference number
<- ioResult OSErr 2 16 Error Code (0=no error, 1=not done yet)
async is a Boolean value. Use FALSE for normal (synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
nsvErr (-35) No such volume

Notes: When a working directory control block is open for a directory, that
directory may not be deleted (PBDelete). The Standard File Package
appears to close WDs as soon as they are out of the direct chain from the
current one to the root.
If ioVRefNum is a 'hard' volume number (instead of a working directory
reference), this function has no effect.