Newsgroups: comp.os.msdos.djgpp From: Peter Berdeklis Subject: Re: Detecting connected disk drives Message-ID: Nntp-Posting-Host: chinook.physics.utoronto.ca Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator) Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: University of Toronto - Dept. of Physics In-Reply-To: Date: Fri, 10 Jan 1997 15:48:41 GMT References: Lines: 27 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Wed, 8 Jan 1997, Shawn Hargreaves wrote: > I have recently discovered a problem with the file selector routines in > Allegro, which is caused by selecting disk B: on a machine with only one > floppy drive. DOS displays the "please insert disk B into drive A" > message, which results in a lockup because the Allegro keyboard handler > prevents the continue keypress getting through to DOS. > > I've racked my brains but can't think of any way round this - please > someone tell me there is an easy solution :-) I need to either disable > the message, or detect whether disk B really exists, but I have no idea > how to do either. Any ideas? How about _bios_equiplist(), or bios_equip() (aliases for the same function I think). Bits 6-7 of the return code tell how many floppy disk drives are installed, 00 = 1, 01 = 2, etc. If only one disk drive is installed it must be drive A:. I have no idea how easily fooled the bios is, but I think it's probably a good bet. If you need to make certain that there is a disk in drive B:, try getmntent(). Successive calls scan drive A:, then B:, then C:, etc. If there is no disk in the drive, ex. drive B:, then the drive is skipped. --------------- Peter Berdeklis Dept. of Physics, Univ. of Toronto