[comp.sys.mac] boot path

schmidt@lsrhs.UUCP (Chris Schmidt) (04/01/88)

Newsgroups: comp.sys.mac
Subject: boot disk path
Expires: 
References: 
Sender: 
Reply-To: schmidt@lsrhs.UUCP (Chris Schmidt)
Followup-To: 
Distribution: world
Organization: Lincoln Sudbury Regional High School. Sudbury Ma.
Keywords: 

Can someone please give me a quick answer?  What's the best way to
determine the volume name of the current startup disk?  I'm using
LSC and don't have a copy of vol4 of IM.

Any help would be appreciated and, well, helpful.

Thanks

jv0l+@andrew.cmu.edu (Justin Chris Vallon) (04/06/88)

To get the volume name of the current startup disk (ie the disk on which the
current System Folder is) in C, use the working directory reference number
of the system folder contained in BootDrive ($210), and then GetVolInfo:

    ParamBlkRec paramBlock;
    paramBlock.ioNamePtr = startupVolName;
    paramBlock.ioVRefNum = *(int *)0x210;
    paramBlock.ioVolIndex = 0;
    PBGetVInfo(&paramBlock, 0); /* returns OsErr */

Note that since BootDrive is an HFS global, this code will fail under the
64K ROMs... but who cares about them anyway :-)  If you want MFS, look at
Inside Mac II-108, which tells you to GetVRefNum of SysMap which returns the
VRN of the system startup volume.
-Justin