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


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
noErr0No error
nsvErr-35No such volume

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996