- my $errs;
- remove_tree($dir, { safe=>1, error=>\$errs });
- if (stat $dir) {
- foreach my $err (@$errs) {
- my ($file, $message) = %$err;
- logm 'info', "problem deleting: $file: $message";
+ my $tdir = "${subdir}\\.tmp";
+ if ($dir ne $tdir) {
+ if (!rename $dir,$tdir) {
+ next if $! == ENOENT;
+ die "$dir: cannot rename to $tdir: $!\n";