Important: The information in this document is obsolete and should not be used for new development.
PBHGetVInfo
You can use thePBHGetVInfofunction to get detailed information about a volume.
FUNCTION PBHGetVInfo (paramBlock: HParmBlkPtr; async: Boolean): OSErr;
paramBlock- A pointer to a basic HFS parameter block.
async- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
--> ioCompletionProcPtrA pointer to a completion routine. <-- ioResultOSErrThe result code of the function. <-> ioNamePtrStringPtrA pointer to the volume's name. <-> ioVRefNumIntegerOn input, a volume specification.
On output, the volume reference number.--> ioVolIndexIntegerAn index used for indexing through all mounted volumes. <-- ioVCrDateLongIntThe date and time of initialization. <-- ioVLsModLongIntThe date and time of last modification. <-- ioVAtrbIntegerThe volume attributes. <-- ioVNmFlsIntegerThe number of files in the root directory. <-- ioVBitMapIntegerThe first block of the volume bitmap. <-- ioVAllocPtrIntegerThe block at which the next new
file starts.<-- ioVNmAlBlksIntegerThe number of allocation blocks. <-- ioVAlBlkSizLongIntThe size of allocation blocks. <-- ioVClpSizLongIntThe default clump size. <-- ioAlBlStIntegerThe first block in the volume
block map.<-- ioVNxtCNIDLongIntThe next unused catalog node ID. <-- ioVFrBlkIntegerThe number of unused
allocation blocks.<-- ioVSigWordIntegerThe volume signature. <-- ioVDrvInfoIntegerThe drive number. <-- ioVDRefNumIntegerThe driver reference number. <-- ioVFSIDIntegerThe file system handling
this volume.<-- ioVBkUpLongIntThe date and time of the last backup. <-- ioVSeqNumIntegerUsed internally. <-- ioVWrCntLongIntThe volume write count. <-- ioVFilCntLongIntThe number of files on the volume. <-- ioVDirCntLongIntThe number of directories on
the volume.<-- ioVFndrInfoARRAY[1..8] OF LongIntInformation used by the Finder. DESCRIPTION
ThePBHGetVInfofunction returns information about the specified volume. If the value ofioVolIndexis positive, the File Manager attempts to use it to find the volume; for instance, if the value ofioVolIndexis 2, the File Manager attempts to access the second mounted volume in the VCB queue. If the value ofioVolIndexis negative, the File Manager usesioNamePtrandioVRefNumin the standard way to determine the volume. If the value ofioVolIndexis 0, the File Manager attempts to access the volume by usingioVRefNumonly. The volume reference number is returned inioVRefNum, and the volume name is returned in the buffer whose address you passed inioNamePtr. You should pass a pointer to aStr31value if you want that name returned. If you passNILin theioNamePtrfield, no volume name is returned.If you pass a working directory reference number in
ioVRefNum(or if the default directory is a subdirectory), the number of files and directories in the specified directory (the directory's valence) is returned inioVNmFls.You can read the
ioVDrvInfoandioVDRefNumfields to determine whether the specified volume is online, offline, or ejected. For online volumes,ioVDrvInfocontains the drive number of the drive containing the specified volume and hence is always greater than 0. If the value returned inioVDrvInfois 0, the volume is either offline or ejected. You can determine whether the volume is offline or ejected by inspecting the value of theioVDRefNumfield. For online volumes,ioVDRefNumcontains a driver reference number; these numbers are always less than 0. If the volume is not online, the value ofioVDRefNumis either the negative of the drive number (if the volume is offline) or the drive number itself (if the volume is ejected).You can get information about all the online volumes by making repeated calls to
PBHGetVInfo, starting with the value ofioVolIndexset to 1 and incrementing that value untilPBHGetVInforeturnsnsvErr.SPECIAL CONSIDERATIONS
The values returned in theioVNmAlBlksandioVFrBlkfields are unsigned integers. You need to exercise special care when reading those values from Pascal. See "Determining the Amount of Free Space on a Volume" on page 2-46 for one technique you can use to read those values.ASSEMBLY-LANGUAGE INFORMATION
The trap macro forPBHGetVInfois_HGetVolInfo.RESULT CODES
noErr 0 No error nsvErr -35 No such volume paramErr -50 No default volume