Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2003, 09:39 PM
cll cll is offline
Junior Member
 
Join Date: Aug 2003
Posts: 2
Default folder.attributes does not work

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
Reply With Quote
  #2 (permalink)  
Old 08-09-2003, 01:03 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:folder.attributes does not work

Hi,

f is a string. The code should be
Code:
d = new Drive("a:\\");
trace(d);
f = new Folder(d.rootFolder);
trace(f);
trace(f.attributes);
Reply With Quote
  #3 (permalink)  
Old 08-11-2003, 03:59 PM
cll cll is offline
Junior Member
 
Join Date: Aug 2003
Posts: 2
Default Re:folder.attributes does not work

Hi, that worked. The trace window printed out "16" which is "folder or directory". But how can I get all the attributes, i.e., a read-only directory?

Thanks a lot!

CL
Reply With Quote
  #4 (permalink)  
Old 08-13-2003, 07:35 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:folder.attributes does not work

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();
}
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:04 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.