Skip to content

Commit

Permalink
Merge pull request #285 from mknos/file-wrongerr
Browse files Browse the repository at this point in the history
file: incorrect error message
  • Loading branch information
briandfoy authored Oct 10, 2023
2 parents 37a3c06 + 5bae8d9 commit c519395
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions bin/file
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,11 @@ for my $file (@ARGV) {
# the description line. append info to this string
my $desc = "$file:";

# 0) check permission
if (! -r $file) {
$desc .= " can't read `$file': Permission denied.";
print $desc,"\n";
next;
}

# 1) check for various special files first
if ($followLinks) {
stat($file);
stat($file) or die("$F: '$file': $!\n");
} else {
lstat($file);
lstat($file) or die("$F: '$file': $!\n");
}

if (! -f _ or -z _) {
Expand Down

0 comments on commit c519395

Please sign in to comment.