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


PBGetVol

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

FUNCTION PBGetVol (paramBlock: ParmBlkPtr; async: Boolean): OSErr;
paramBlock
A pointer to a basic File Manager 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 reference number
or a working directory
reference number.

DESCRIPTION
The PBGetVol function returns, in ioNamePtr, a pointer to the name of the default volume (unless ioNamePtr is NIL) and, in ioVRefNum, its volume reference number. If a default directory was set with a previous call to PBSetVol, a pointer to its name is returned in ioNamePtr and its working directory reference number is returned in ioVRefNum. However, if, in a previous call to HSetVol (or PBHSetVol), a working directory reference number was passed in, PBGetVol returns a volume reference number in the ioVRefNum field.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro for PBGetVol is _GetVol.

RESULT CODES
noErr0No error
nsvErr-35No default volume

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996