[comp.sys.mac.programmer] VRefNum to Drive Number

mikeoro@hubcap.clemson.edu (Michael K O'Rourke) (12/16/89)

Does anyone know how to get a drive number from a volume reference number?
I use SFGetFile to let a user open a file.  AFter that i need to see if the 
volume the file is on is ejectable or not.  The only way i know of doing
so is to look thru the drive queue, but i need a drive number for that. (There
is a bit i can look at with assembly to see if the volume is ejectable)

Thanx,
Michael O'Rourke

blob@apple.com (Brian Bechtel) (12/16/89)

In article <7463@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K 
O'Rourke) writes:
> Does anyone know how to get a drive number from a volume reference 
> number?

Use PBHGetVInfo.  The drive number is returned in ioVDrvInfo.  See IM 
IV-124 and 130 for more details.

--Brian Bechtel     blob@apple.com     "My opinion, not Apple's"

tim@hoptoad.uucp (Tim Maroney) (12/17/89)

In article <7463@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu
(Michael K O'Rourke) writes:
>Does anyone know how to get a drive number from a volume reference number?

PBHGetVInfo returns the drive number in the field ioVDrvInfo.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"Next prefers its X and T capitalized.  We'd prefer our name in lights in
 Vegas."  -- Louis Trager, San Francisco Examiner