Important: The information in this document is obsolete and should not be used for new development.
HGetVol
You can use theHGetVolfunction to determine the current default volume and
default directory.
FUNCTION HGetVol (volName: StringPtr; VAR vRefNum: Integer; VAR dirID: LongInt): OSErr;
volName- A pointer to the name of the default volume.
vRefNum- A volume reference number or a working directory reference number.
dirID- The directory ID of the default directory.
DESCRIPTION
TheHGetVolfunction returns the name and reference number of the default volume, as well as the directory ID of the default directory. A pointer to the name of the default volume is returned in thevolNameparameter, unless you setvolNametoNILbefore callingHGetVol.The
HGetVolfunction returns a working directory reference number in thevRefNumparameter if the previous call toHSetVol(orPBHSetVol) passed in a working directory reference number. If, however, you have previously calledHSetVol(orPBHSetVol) specifying the target volume with a volume reference number, thenHGetVolreturns a volume reference number in thevRefNumparameter.RESULT CODES
noErr 0 No error nsvErr -35 No default volume