This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Detecting CD-ROM drive
- To: Arlindo da Silva <arlindo at niteroi dot gsfc dot nasa dot gov>
- Subject: Re: Detecting CD-ROM drive
- From: "$Bill Luebkert" <dbe at wgn dot net>
- Date: Thu, 30 Oct 1997 13:39:21 -0800
- CC: gnu-win32 at cygnus dot com
- Organization: DBE Collectibles
- References: <199710300338.WAA00907@woodmore.gsfc.nasa.gov>
Arlindo da Silva wrote:
>
> Does anybody know how to determine which drive (d:, e:, ...) is a CDROM?
> Is there any native function for this? Thanks.
Have you tried something like:
#include <stdio.h>
#include <winbase.h>
#include <mntent.h>
main () {
int ii;
for (ii = 0; ii < 26; ii++) {
char tmp[32];
int type;
(void)sprintf (tmp, "%c:\\", ii + 'A');
type = GetDriveType (tmp);
if (type == DRIVE_CDROM) {
(void)printf ("%s\n", tmp);
}
}
}
--
,-/- __ _ _ $Bill Luebkert
(_/ / ) // // DBE Collectibles
/ ) /--< o // // http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_ Email: dbe@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".