|
|||
|
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. |
|
|||
|
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();
}
|
|
|||
|
>
![]() *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. |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|