Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Write Protection
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00004859
Message ID:
00004864
Views:
49
>Does anyone know of a way to check for write protection on a diskette using a Visual FoxPro command? More importantly, is there a way to trap the "error"?
>
>Thanks, Rob

You could try it the way Windows '95 checks for Windows NT file/directory permissions -- it doesn't! <s>

What is does is it tries to create a dummy file on the questionable directory. If that succeeds, then it knows it can create a file in the directory and goes on doing what it was supposed to do in the first place.

Try opening a dummy file for write on the drive. Make sure to use ON ERROR and try to trap the error in your custom error handling procedure. Then just delete the dummy file if it succeeds.
alistair israel
Distressed DBA, Sleepy SysAd, Weary WebMaster (aka Senior Software Engineer)
aisrael@poboxes.com
Makati City, Philippines
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform