Created
May 12, 2014 10:13
-
-
Save gdugas/8f0a4e7f7fc8a7fd970d to your computer and use it in GitHub Desktop.
findbot.pl per file detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82c82 | |
< | |
--- | |
> | |
94,105c94,95 | |
< my (@list); | |
< if (!opendir(I, "$dir")) { | |
< return if $! =~ /no such file/i; | |
< print STDERR "$dir: Can't open: $!, skipping\n"; | |
< return; | |
< } | |
< @list = readdir(I); | |
< closedir(I); | |
< for my $mfile (@list) { | |
< next if $mfile =~ /^\.\.?$/; # skip . and .. | |
< my $cf = $currentfile = "$dir/$mfile"; | |
< | |
--- | |
> my $cf = $currentfile = $mfile = $dir; | |
> | |
108a99,100 | |
> my $type = `$file $cf`; | |
> | |
114c106 | |
< if ($mfile =~ /$scripts/) { | |
--- | |
> if ($type =~ /text/) { | |
122c114 | |
< next if -s $currentfile > 1000000 || -s $currentfile < 2000; | |
--- | |
> next if -s $currentfile > 1000000;# || -s $currentfile < 2000; | |
126,127d117 | |
< my $type = `$file $cf`; | |
< | |
144d133 | |
< } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment