Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!zardoz!dhw68k!thecloud From: thecloud@dhw68k.cts.com (Ken McLeod) Newsgroups: comp.sys.mac.programmer Subject: Re: Telling Floppies from Hard Disks Summary: easy, but how to distinguish 800K from FDHD? Message-ID: <25946@dhw68k.cts.com> Date: 27 Aug 89 09:22:15 GMT References: <1742@cs-spool.calgary.UUCP> <3841@internal.Apple.COM> Reply-To: thecloud@dhw68k.cts.com (Ken McLeod) Organization: Wolfskill & Dowling residence; Anaheim, CA (USA) Lines: 39 In article <3841@internal.Apple.COM> blob@apple.com (Brian Bechtel) writes: >In article <1742@cs-spool.calgary.UUCP> jamesm@cpsc.ucalgary.ca (Mark >James) writes: >> I'm looking for a method to test a volume to see if it is a floppy or a >> hard drive. I have written an INIT to patch PBMountVol to check an > >It sounds like what you really want to check is if a device in the drive >queue is removable or not. To do this, examine the four bytes of flags >preceeding the drive queue entry for this device. See Inside Mac > [code to examine DQE flags omitted...] >Now if you really want to know if a volume is a floppy or not, use >PBHGetVInfo, and multiply out the ioVNmAlBlks (remember, it's unsigned!) >times ioVAlBlkSiz. Currently valid sizes include 400K, 800K, 720K, 1440K. >How will you handle other sizes from the future? Nasty. That's why I >think you are really asking to detect removable media. Is there a method for determining whether a given floppy drive in the queue is a FDHD (SuperDrive)? Volume-related calls are useless, since the drive may not currently contain a mounted volume... and the flags preceding the entry in the drive queue seem to be invalid if a disk hasn't yet been inserted (i.e. you boot from a hard drive). My application wants to display information about the drive itself, and not the volume which it may or may not contain. I've tried sleuthing the driver variables pointed to by the global at $134, using the MPW 3.0 Sony equates as a guide, but none of the values in the FDHD-related fields are different from that of a standard 800K drive (until you do something like mount an MFM disk). Thanks for any reponses, code snippets, etc.! >--Brian Bechtel blob@apple.com "My opinion, not Apple's" -ken -- ========== ....... ============================================= Ken McLeod :. .: UUCP: ...{spsd,zardoz,felix}!dhw68k!thecloud ========== :::.. ..::: INTERNET: thecloud@dhw68k.cts.com //// =============================================