Checking drives on XP

Richard Gaskin ambassador at fourthworld.com
Wed Mar 12 01:36:00 EST 2003


To test for the presence of a CD, I use a technique widely discussed here in
which we get a list of mounted devices by checkng the drives function, and
then walk through the list checking for a specific file known to be on the
CD we're looking for.

On all platforms this metod works great - except XP.

In XP, it seems that checking for the existence of a file will cause the OS
to bring up an errr dialog if the device is for removable media and no media
is currently in the drive.  Bummer.

I've read the tip from Ken's excellent compendium culled from this list, and
the note at <http://www.sonsothunder.com/devres/metacard/tips/disk005.htm>
suggests that the only way to query a drive in XP without generating this
error is to rely on a third-party command-line app first to see if the drive
has media or not.

It won't kill us to do the extra steps outlined there, but it feels somewhat
"unclean" to rely on an obscure third-party app for such a common task.

Has anyne found a reliable way to check to see if a particular CD is mounted
without triggering an XP error -- in native MetaTalk?

Thanks in advance -

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the metacard mailing list