vcbXTRef
VCB structure
#include <Files.h>
typedef struct VCB { Size Offset Description
struct QElem * qLink; 4 0 Address of next queue element
(0=last)
short qType; 2 4 Always fsQType (5)
short vcbFlags; 2 6 Bit 15=1 when volume needs
flushing (dirty)
unsigned short vcbSigWord; 2 8 File sys signature: 0x4244=HFS,
0xD2D7 = flat
unsigned long vcbCrDate; 4 10 Date/Time of initialization
unsigned long vcbLsMod; 4 14 Date/Time of last modification fi*
short vcbAtrb; 2 18 Volume Attributes
unsigned short vcbNmFls; 2 20 Number of files in the root directory
short vcbVBMSt; 2 22 Sector of start of volume bit map fi*
short vcbAllocPtr; 2 24 ( internal: start looking for free
space here) fi*
unsigned short vcbNmAlBlks; 2 26 Total allocation blocks on volume *
long vcbAlBlkSiz; 4 28 Size of an allocation block, in bytes
long vcbClpSiz; 4 32 Default clump size, in bytes
short vcbAlBlSt; 2 36 First sector re presented in bit map
(flat vols)
long vcbNxtCNID; 4 38 Next serial number for new file or
dir fi*
unsigned short vcbFreeBks; 2 42 Number of unused allocation blocks
Str27 vcbVN; 28 44 Length-prefixed volume name
short vcbDrvNum; 2 72 Drive number
short vcbDRefNum; 2 74 Driver reference number
short vcbFSID; 2 76 File system ID (0=native;
else=external)
short vcbVRefNum; 2 78 Volume reference number
Ptr vcbMAdr; 4 80 Address in memory of block bit map
Ptr vcbBufAdr; 4 84 Address of volume I/O buffer
short vcbMLen; 2 88 Size of block bit map, in bytes
short vcbDirIndex; 2 90 (used internally)
short vcbDirBlk; 2 92 (used internally) (* last field if
MSF present)
unsigned long vcbVolBkUp; 4 94 Date/Time of last backup
unsigned short vcbVSeqNum; 2 98 Sequence number (if this is a backup
diskette)
long vcbWrCnt; 4 100 Volume write count
long vcbXTClpSiz; 4 104 Clump size of extents tree file
long vcbCTClpSiz; 4 108 Clump size of catalog tree file
unsigned short vcbNmRtDirs; 2 112 Number of directories in the root
long vcbFilCnt; 4 114 Total number of files on the volume
long vcbDirCnt; 4 118 Total number of directories on the
long vcbFndrInfo[8]; 32 122 Data used by Finder
122 (long) dirID of the 'blessed folder'
126 (long) dirID of directory of startup
application
130 (long) dirID of first folder in Finder
chain
. . . (other undocumented fields)
unsigned short vcbVCSize; 2 154 Size of volume cache
( undocumented)
unsigned short vcbVBMCSiz; 2 156 Size of vol block map cache
( undocumented)
unsigned short vcbCtlCSiz; 2 158 Size of common cache for vol info
(undoc'ed)
unsigned short vcbXTAlBlks; 2 160 Size of extents tree file, in blocks
unsigned short vcbCTAlBlks; 2 162 Size of catalog tree file, in blocks
short vcbXTRef; 2 164 Path reference number of extents
tree file
short vcbCTRef; 2 166 Path reference number of catalog
tree file
Ptr vcbCtlBuf; 4 168 Address of extents and catalog tree
caches
long vcbDirIDM; 4 172 dirID of directory last searched
short vcbOffsM; 2 176 Offspring index at last search
} VCB ; 178

Notes: The states of vcbDRefNum and vcbDrvNum can be used to see if a volume
is currently on-line, off-line, or ejected:
On-line: vcbDRefNum < 0 and vcbDrvNum > 0
Off-line: vcbVDRefNum < 0 and vcbDrvNum = 0
Ejected: vcbVDRefNum = 0 and vcbDrvNum > 0
The 'blessed' folder for this volume, found at vcbFndrInfo[0], is the folder
which contains the system resource file and the Finder. Use SysEnvirons
or FindFolder to find the 'blessed' folder which contains the currently
open system resource file.
The global variable VCBQHdr contains the queue header for the chain of
volume control blocks. The global variable DefVCBPtr points to the VCB of
the current default volume (see PBSetVol).
Use GetVCBQHdr to access the start of the volume queue. We are
encouraged to avoid 'walking' the VCB queue since you can use PBGetVInfo
to index through all volumes.
64K ROM Note: A volume control block created for a flat volume is a
subset of the above structure. It's actually smaller and contains only the
fields up to and including vcbDirBlk. In addition, the names of several
fields have been changed to reflect the fact that they contain different
information on hierarchical volumes: vcbLsBkUp, vcbDirSt, vcbBlLn,
vcbNumBlks, and vcbNexFNum have been changed to vcbLsMod, vcbVBMSt,
vcbAllocPtr, vcbNmAlBlks, and vcbNxtCNID, respectively. The name
vcbLsBkUp was actually a misnomer; this field has always contained the date
and time of the last modification, not the last backup. Another field,
vcbVolBkUp, contains the date and time of the last backup.