Check Write Protection
Hugh Senior
H at flexibleLearning.com
Fri Apr 26 13:56:01 EDT 2002
Scott Rossi asked:
>On Windows, how does one check if a volume is write protected, such as a CD
>or some other locked volume?
>Related: how does one check the write status of a target folder without
>resorting to checking the detailed folder info of the target folder's
>parent?
What we do is write a dummy text file and test for success or failure... If
it fails it's either a write-protected medium, or the user does not have
write-permissions.
As for the related check for write status, you should be able to use
shell("attrib") to get a file's read-only status (command prompt C:\> HELP
ATTRIB for the syntax needed). I tried starting with this, but it kinda
falls over...
on mouseUp
answer file "choose file:"
replace "/" with "\" in it
get shell("attrib"&&"R"&&it)
end mouseUp
Sorry. Maybe someone else has more insight!
/H
-------------- next part --------------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
More information about the metacard
mailing list