Borland C ++ Builder FAQ
The content The last update: 12/12/2008

How to check up diskette presence in the disk drive?

The author: kenai, OlegGG
The initial link: - - -

To use function:
bool IsDriveReady (char drive) 
{ 
bool out; 
WORD OldErrorMode = SetErrorMode (SEM_FAILCRITICALERRORS); 
AnsiString path = AnsiString (drive) + ": \\"; 
out = (SetCurrentDirectory (path.c_str()! = 0); 
SetErrorMode (OldErrorMode); 
return out; 
}
Usage example:
if (IsDriveReady (' a ')) 
        { 
        ShowMessage ("the Diskette it is interposed"); 
        }