Skip to content

Commit 8895e4b

Browse files
authored
rmdir: better error reporting (#803)
* The old error message is not specific enough to be helpful * Allow rmdir() to fail instead of performing file tests first * $! will specifically say whether a file argument does not exist, or is not a directory
1 parent 9cc12e8 commit 8895e4b

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

bin/rmdir

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ if (!getopts('p', \%opt) || scalar(@ARGV) == 0) {
3030
exit EX_FAILURE;
3131
}
3232
foreach my $directory (@ARGV) {
33-
unless (-d $directory) {
34-
warn "$Program: '$directory': not a directory or does not exist\n";
35-
$rc = EX_FAILURE;
36-
next;
37-
}
3833
unless (rmdir $directory) {
3934
warn "$Program: failed to remove '$directory': $!\n";
4035
$rc = EX_FAILURE;

0 commit comments

Comments
 (0)