/ Published in: Perl
Recursive delete of given file or folder, e.g. .svn folder
Call : [Program] [SearchPath] [DeleteItem]
Call : [Program] [SearchPath] [DeleteItem]
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/perl use strict; use File::Find; use File::Path; if(!($ARGV[0] && $ARGV[1])){ exit; } (my $startToSearchDir, my $deleteItem) = @ARGV; find(\&wanted, $startToSearchDir); sub wanted { if($_ eq $deleteItem){ if(-d $File::Find::name) { rmtree($deleteItem); } else { } } }