From: "Damian Yerrick" Newsgroups: comp.os.msdos.djgpp Subject: Re: How to detect drives attached to a system Date: Mon, 4 Oct 1999 11:53:56 -0500 Organization: Rose-Hulman Institute of Technology Lines: 29 Message-ID: <7tam6v$ist$1@solomon.cs.rose-hulman.edu> References: <7t993c$d8a$1 AT solomon DOT cs DOT rose-hulman DOT edu> NNTP-Posting-Host: yerricde.laptop.rose-hulman.edu X-Trace: solomon.cs.rose-hulman.edu 939056159 19357 137.112.111.210 (4 Oct 1999 16:55:59 GMT) X-Complaints-To: news AT cs DOT rose-hulman DOT edu NNTP-Posting-Date: 4 Oct 1999 16:55:59 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote in message news:Pine DOT SUN DOT 3 DOT 91 DOT 991004103456 DOT 23739L-100000 AT is... > >8 [dangerous code snipped > I think this code is dangerous: it will crash under some DPMI servers > (e.g. QDPMI) What doesn't crash on QDPMI? Even RHIDE crashed on QDPMI. > if you try to switch to a floppy drive without a disk, or > with unformatted disk. The same happens with a CDROM drive that is empty > or has an audio disk inserted. > > > Is there a more portable way to detect all drives on a system? > > Use the library function `getmntent'. It will report all valid drives > that have media in them, one by one, and already implements all the > tricks required to avoid the above-mentioned gotchas. It also reports > additional info on the drives, which you might find useful; see the > library docs for details. I'll look at it. > `getmntent' is portable to many Unix systems. OT: But is it portable to Win32? Mac? Be? What is?