Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-24-2003, 05:39 AM
Member
 
Join Date: Sep 2003
Posts: 95
Default folder.remove and deleteKey

Just curious as to whether these functions are going to be written so that the specified path doesn't have to be empty for it to be deleted?

It is very irritating having to manually clear a folder before it can be removed....

Cheers,

G.
Reply With Quote
  #2 (permalink)  
Old 10-26-2003, 12:04 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:folder.remove and deleteKey

Hi, we provide new methods in SWFKit 2 to remove folders or delete keys without limit. In swfkit 1, you must do it with a recursive function.
Code:
function remove_all(path)
{
  var folder = new Folder(path);

  var files = folder.files;
  var folders = folder.subFolders;

  var i;

  for (i = 0; i < files.length; i++) 
  {
    (new File(files[i])).remove();
  }

  for (i = 0; i < folders.length; i++) remove_all(folders[i]);

  folder.remove();
}
Reply With Quote
  #3 (permalink)  
Old 10-26-2003, 08:47 PM
Member
 
Join Date: Sep 2003
Posts: 95
Default Re:folder.remove and deleteKey

;D

Thanks, I know, just curious if it was to be done differently in SWFKit 2....

Which it is.

Cheers,

G.
Reply With Quote
  #4 (permalink)  
Old 10-28-2003, 10:33 AM
Member
 
Join Date: Sep 2003
Posts: 95
Default Re:folder.remove and deleteKey

>

*MASSIVE BUMP*

Will the folder.remove function be written so that it can get rid of read-only files??

I really need to be able to do this....

I can't find ANY functionality to remove the read-only attribute of a file using SWFKit (file.attribute doesn't even appear to return anything)....

Currently then, this means that on any operating system (except Windows 2000) any file (or folder containing files) with read-only attributes can NOT get deleted?!?!

To try and work around it, I've tried to find the path to the folder then do Shell.run("attrib -R" + path + " /S"); but attrib seems to not like it when you specify a path....

I've looked into batch files, but they will all have to run attrib at some point, and if it breaks as soon as you enter a path then I am at a loss....

Any ideas?

Cheers,

G.
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 05:30 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.