RemoveEmptyFolders.xys 696 B

123456789101112131415161718192021222324
  1. ::/** XYplorer: Remove Empty Folders
  2. Remove recursively all empty folder from the current folder.
  3. At the end, it shows the execution log.
  4. @author rdoi
  5. @created feb/2014
  6. */
  7. $log="RemoveEmptyFolders.xys: RDoi Empty folders remover<crlf>-------------------------------<crlf>";
  8. $folder=get("Path");
  9. $log=$log."Processing '".$folder."' folders...<crlf>";
  10. $flist=formatlist(folderreport("dirs","r",$folder,"r",,"|"),"r","|")."|".$folder;
  11. $count=0;
  12. foreach($f, $flist,"|") {
  13. $content=listfolder($f,,0,"|");
  14. if ($content=="") {
  15. delete 0,0,$f;
  16. $log=$log."Removed: ".$f."<crlf>";
  17. $count=$count+1;
  18. }
  19. }
  20. $log=$log.">>> ".$count." folders removed.";
  21. beep;
  22. text $log;