Mail Archives: djgpp/1996/01/19/14:27:11
> From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
>
> Please how in Gnu C++ can I find
> easily at run time for(i='A';i<='Z';i++) whether drive i exists? And I don't
> want in the process any empty floppy or CD-ROM drives making rude noises at me
> or wanting Abort/Fail/Retry. I don't mind if an empty floppy drive is treated
> as nonexistent.
For each drive try to set it as current and then look if the current drive is
the same as set. Beware: I didn't test it.
for(i='A'; i<='Z'; i++)
{
set_current_drive(i);
if(i==get_current_drive(i))
/* the drive i does exist */ ;
}
This should detect empty floppy and cdrom drives too.
---
Alexander Lukyanov
lav AT video DOT yars DOT free DOT net
- Raw text -