Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!well!gurgle From: gurgle@well.sf.ca.us (Pete Gontier) Newsgroups: comp.sys.mac.programmer Subject: Re: Determining if a drive is a hard drive Message-ID: <20945@well.sf.ca.us> Date: 4 Oct 90 15:57:48 GMT References: <1219@beguine.UUCP> Organization: cellular Lines: 36 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 You can write a little program which will allow you to select volumes and list their driver names. The problem is that some of the names are misleading. For example, third-party SCSI and CD-ROM drives don't have driver names that match Apple's. The most confusing part is when you get a result of .SONY. .SONY is supposed to be the driver for floppy drives, and it is, but it's also the driver for the old Apple HD20 (notice lack of SC). So you end up doing size comparisons. Real fun stuff. You can get a tech note from Sitka Corp. (the makers of TOPS) on this topic if you sound like you're serious about TOPS compatibility. I should add that it's now someone's cue to pipe up and bitch about how it's bad practice to run the VCB queue and read strings directly out of drivers and such like. Well, it is. Let's hope the person who ends up writing this also is able to supply a better methodology. -- Pete Gontier, gurgle@well.sf.ca.us Software Imagineer, Kiwi Software, Inc.