GetVol
You can use the GetVol function to determine the current default volume and possibly also the default directory.
FUNCTION GetVol (volName: StringPtr; VAR vRefNum: Integer): OSErr;
volName
- A pointer to the name of the default volume.
vRefNum
- A volume reference number or a working directory reference number.
DESCRIPTION
The GetVol function returns a pointer to the name of the default volume in the volName parameter and its volume reference number in the vRefNum parameter. If the default directory has a working directory associated with it, the vRefNum parameter instead contains a working directory reference number (which encodes both the volume reference number and the default directory ID). However, if, in a previous call to HSetVol (or PBHSetVol), a working directory reference number was passed in, GetVol returns a volume reference number in the vRefNum parameter.
RESULT CODES
| noErr | 0 | No error |
| nsvErr | -35 | No such volume |