Mail Archives: djgpp/1995/06/08/09:15:18
> Does anybody know how to supress the 'Abort,Retry, or Cancel' msg when you
> don't have a floppy disc loaded and you've tried to save/load. We've got this
> box with a 386 in it and no monitor (or keyboard). We get interaction from a
> series of knobs and buttons.
You can try to read the first disk sector with a BIOS call, like this:
unsigned char buf[512];
int bios_status, count = 0;
/* Int 13h/AH=02h returns 6 for disk changed, even if the
disk isn't readable (e.g., unformatted). Retry the
operation after disk change, each time resetting the
drive, until something other than 6 is returned or we
run out of our patience. */
while (++count < 10 && (bios_status =
biosdisk(2, drive_number - 1, 0, 0, 1, 1, buf)) == 6)
biosdisk(0, drive_number - 1, 0, 0, 0, 0, NULL);
/* If the loop ends with nonzero status, fail. */
if (bios_status != 0)
do-whatever-it-takes-for-empty-drive;
- Raw text -