- my $errs;
- remove_tree($tdir, { safe=>1, error=>\$errs });
- if (!stat $tdir) {
- foreach my $err (@$errs) {
- my ($file, $message) = %$err;
- logm 'info', "problem deleting: $file: $message";
- }
- die "$dir: problem deleting file(s)\n";
+ system qw(rm -rf --), $tdir;
+ if (stat $tdir) {
+ die "$dir: problem deleting file(s), rm exited $?\n";
+ } elsif ($! != ENOENT) {
+ die "$tdir: cannot stat after deletion: $!\n";