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


HGetVol

You can use the HGetVol function 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
The HGetVol function 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 the volName parameter, unless you set volName to NIL before calling HGetVol.

The HGetVol function returns a working directory reference number in the vRefNum parameter if the previous call to HSetVol (or PBHSetVol) passed in a working directory reference number. If, however, you have previously called HSetVol (or PBHSetVol) specifying the target volume with a volume reference number, then HGetVol returns a volume reference number in the vRefNum parameter.

RESULT CODES
noErr0No error
nsvErr-35No default volume

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996