next up previous contents
Next: move Up: Methods Previous: copy   Contents

remove

Description

Deletes a specified file or folder. The method can only remove empty folders. If you want to remove all files and subfolders, use a recursive function like this:

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();
}
CAUTION: The function won't put the deleted folders into the recycle bin. You cannot recovery them anymore.


Syntax

folder.remove()


Parameters

None


Returns

Boolean. Returns true for success, false for failure.




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.