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 Volume Access Routines / Manipulating the Default Volume


PBHGetVol

You can use the PBHGetVol function to determine the default volume and default directory.

FUNCTION PBHGetVol (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.
<--ioResult OSErrThe result code of the function.
<--ioNamePtrStringPtrA pointer to a pathname.
<--ioVRefNumIntegerA volume reference number or a working directory reference number.
<--ioWDProcIDLongIntThe working directory user identifier.
<--ioWDVRefNumIntegerThe volume reference number of the default volume.
<--ioWDDirIDLongIntThe directory ID of the default directory.

DESCRIPTION
The PBHGetVol function returns the default volume and directory last set by a call
to either PBSetVol or PBHSetVol. The reference number of the default volume is returned in ioVRefNum. The PBHGetVol function returns a pointer to the volume's name in the ioNamePtr field. You should pass a pointer to a Str31 value if you
want that name returned. If you pass NIL in the ioNamePtr field, no volume name
is returned.

WARNING
On exit, the ioVRefNum field contains a working directory reference number (instead of the volume reference number) if, in the last call to PBSetVol or PBHSetVol, a working directory reference number was passed in this field.
The volume reference number of the volume on which the default directory exists
is returned in ioWDVRefNum. The directory ID of the default directory is returned
in ioWDDirID.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBHGetVol is _HGetVol.

RESULT CODES
noErr0No error
nsvErr-35No default volume

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996