|
|||
|
I am working on a project that needs to write to a floppy disk. I used the following code to see if the floppy disk is read-only:
d = new Drive("a:\\"); f = d. rootFolder; trace(f.attributes); It told me that "attributes" is an invalid property. Any help??? CL ![]() |
|
|||
|
Sorry, "f.attributes" always returns 16, the method cannot work.
Furthermore, a read-only folder doesn't mean that you cannot create new files in it, but mean that you cannot delete it. You can try the following code Code:
var name = "a:\\tmp";
var f = new FileStream(name, "w");
if (f == null)
{
trace("Disk A: is read-only");
}
else
{
trace("Disk A: is writtable");
f.close();
(new File(name)).remove();
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|