Mail Archives: djgpp/1997/01/11/08:19:58
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
- Raw text -