|
|
|
|
|
by ralph
4769 days ago
|
|
This Perl beats rsync by quite a margin here. perl -e 'opendir D, "."; @f = grep {$_ ne "." && $_ ne ".."} readdir D;
unlink(@f) == $#f + 1 or die'
It goes a bit quicker still if @f and the error handling are omitted.The original article is comparing different things some of the time, e.g. find is having to stat(2) everything to test if it's a file. |
|