Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!mimsy!mojo!russotto From: russotto@eng.umd.edu (Matthew T. Russotto) Newsgroups: comp.sys.mac.programmer Subject: Re: Determining if a drive is a hard drive Message-ID: <1990Oct4.205555.3700@eng.umd.edu> Date: 4 Oct 90 20:55:55 GMT References: <1219@beguine.UUCP> <20945@well.sf.ca.us> Sender: news@eng.umd.edu (The News System) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 26 In article <20945@well.sf.ca.us> gurgle@well.sf.ca.us (Pete Gontier) writes: >In article <1219@beguine.UUCP> Eliot.Henry@samba.acs.unc.edu writes: >> I was following the discussion a month ago about determining if a drive is >>a floppy drive. I need to figure out how to create a list of all hard drives >>(BOTH SCSI and nonSCSI) Any help, or suggestions or sample code in C or pascal >>would be greatly appreciated! The file manager is so confusing! Thanks again! > >Whew! This is a doozy. What I've done in the past is very complex. Here's a >summary: > > get the vRefNum of the volume you want to ID > run the VCB queue looking for that vRefNum > get the handle (pointer) to the volume's driver > get the name of the driver - it's at an offset into the driver > do all sorts of fun string comparisons > .SCSI00 Apple SCSI volume > .AFPTranslator AppleShare > .TOPS TOPS Hmm.. it isn't actually that hard-- why not walk the drive queue looking for nonejectable, writeable drives? (Call drivestatus to see if the drive is writeable-- this will exclude CDs, and hardware-locked hard drives) (you won't get any remote volumes, but you can't find out what they are anyway) -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu .sig under construction, like the rest of this campus.