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


HSetVol

You can use the HSetVol function to set both the default volume and the default directory.

FUNCTION HSetVol (volName: StringPtr; vRefNum: Integer; 
                  dirID: LongInt): OSErr;
volName
A pointer to the name of a mounted volume or the partial pathname
of a directory.
vRefNum
A volume reference number or a working directory reference number.
dirID
A directory ID.
DESCRIPTION
The HSetVol function lets you specify the default directory by volume reference number, by directory ID, or by a combination of working directory reference number
and partial pathname (beginning from that working directory).

WARNING
Use of the HSetVol function is discouraged if your application may execute in system software versions prior to version 7.0. Because the specified directory might not itself be a working directory, HSetVol records the default volume and directory separately, using the volume reference number of the volume and the actual directory ID of the specified directory. Subsequent calls to GetVol (or PBGetVol) return only the volume reference number, which will cause that volume's root directory (rather than the default directory, as expected) to be accessed.
Note
Both the default volume and the default directory are used in calls made with no volume name, a volume reference number of 0, and a directory ID of 0.
RESULT CODES
noErr0No error
nsvErr-35No such volume
bdNamErr-37Bad volume name
fnfErr-43Directory not found
paramErr-50No default volume
afpAccessDenied-5000User does not have access to the directory

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996