Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verification of empty CD drive
Message
 
To
22/08/2005 14:14:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01042710
Message ID:
01042714
Views:
20
>Hi,
>
>I was wondering if anyone has a simple way of verifying if a CD or DVD drive has media in it. I have code that figures out what drive letters are the CD and/or DVD drives. Next I want to see what is on the media of these drives. If it is empty I want to skip over it. But I can't figure out how to tell if the drive is empty or not other than using 'SET DEFAULT TO d:\' and getting an "invalid path of file name" error if the drive is empty. Any ideas? Thanks!
>
>Tim

One easy way is using Diskspace function

if Diskspace(lcDriveLetter) = -1 && No CD inserted

Noting the following warning:

"The return value of DISKSPACE( ) might not be accurate for large network drives on some networks. Additionally, DISKSPACE( ) may return -1 for certain long named directories on Windows 98."
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform