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.
| --> | 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 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
| noErr | 0 | No error |
| nsvErr | -35 | No default volume |