Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!ut-sally!ut-ngp!ut-dillo!darin From: darin@ut-dillo.UUCP (Darin Adler) Newsgroups: net.micro.mac Subject: Re: How to find LaserWriter file (actually GetVRefNum) Message-ID: <165@ut-dillo.UUCP> Date: Fri, 11-Apr-86 01:20:35 EST Article-I.D.: ut-dillo.165 Posted: Fri Apr 11 01:20:35 1986 Date-Received: Sun, 13-Apr-86 07:22:08 EST References: <42@uva.UUCP> Organization: UTexas Computation Center, Austin, Texas Lines: 31 Summary: Use BootDisk In article <42@uva.UUCP>, dolf@uva.UUCP (Dolf Starreveld) writes: > My idea was: > 1) Look at STR resource ID -8192 in the System file to find out > what the currently selected printer is. > 2) Use the name contained in the resource as the name of the file > with the printer driver. (Is this the correct way of determing > the name of the LW file?) > Problem: > Generally my application won't be in the System Folder, nor will it > be on the same disk as the System Folder. Therefore calling OpenResFile > won't always result in actually opening the LaserWriter file. To > accomplish this I need to no the vRefNum of the volume the LW file > is located on. (Dolf then mentions Aztec C) The System Folder is always open as a Working Directory under HFS. That means that there is always a WDRefNum (or vRefNum) that identifies it, under MFS *or* HFS. That vRefNum is stored in a low-memory global, "BootDrive". Contrary to what that misleading name may have you believe, this contains the WDRefNum (or vRefNum) of the System Folder. I do not program much in C, but I think that something like this should do the trick: #define BootDrive (* (short *) 0x210) Good Luck, -- Darin Adler ...!ut-sally!ut-dillo!darin darin@dillo.CC.UTEXAS.EDU "...'cause they don't go for what's in the book and that makes 'em bad..." Frank Zappa