From: "A.Appleyard" To: DJGPP AT sun DOT soe DOT clarkson DOT edu Date: Mon, 22 Jan 1996 12:14:05 GMT Subject: Is there a floppy in the drive? I have had another go at the query of finding if there is a floppy in a drive without DOS making graffiti over my screen display asking me for Abort/Fail/Retry/Ignore. In reply to suggestions sent to djgpp email group around May 1995 I wrote this:- int drive_is_empty(int d/* physical drive number */){c_mem BUF(512); int i=3; A: i--; R.x.ax=0x0201; R.x.es=BUF.x.rm_segment; R.x.bx=BUF.x.rm_offset; R.x.cx=0; R.x.dx=d&0xff; Int(0x13); if(!(R.x.flags&1)) return 0; if(!i) return (R.x.ax>>8)==0x80; R.x.ax=0; R.x.dx=0; Int(0x13); goto A;} /* c_mem declares an area of conventional memory, and frees it on exit from the function */ (0) How, whether any netware is running or not, can Gnu C++ program, given a logical drive letter A: to Z:, find easily if it is hard or floppy or CD-ROM or net or a ramdisk or a net drive or whatever or nonexistent? `AH=0x1c, int21' seems to go part of the way, but (a) when called on an empty floppy or CD-ROM drive it wants Abort/Retry/Fail; (b) if my information source is correct it seems to have no way to distinguish CD-ROM drives; (c) it seems to act odd on Novell Net logical drives. (1) Eli Zaretskii mentioned a coming v2.0 function getmntent(); (a) what exactly will this function do?, (b) when will v2.0 be fully debugged and up and on Simtel? (2) How, whether any netware is running or not, can Gnu C++ program, given a logical drive letter A: to Z: which is floppy or CD-ROM, find easily if it corresponds directly to a physical drive, and, if so, what is its physical drive number for use as DL in my `AX=0x0201, int13' as hereinabove? (3) Will my hereinabove drive_is_empty() work with a CD-ROM drive? They also may or may not have a disk in. If not, how to find if a CD_ROM drive has a CD_ROM in or not? (4) If a PC floppy drive has a `bad' floppy in, how can the program find easily if that floppy is probably in native Mac mode? (5) I know of these sorts of logical drives: floppy empty; floppy full; CD-ROM empty; CD-ROM full; hard; ramdisk; net; nonexistent; are there any other sorts? How can the program distinguish them all?