If C<do-links\r> line is presented, then links-table is forcefully generated.
C<do-backs\r> generated backlinks table.
+=head1 IGNORED FILES
+
+You can ignore specified files processing by placing regular expressions
+on separate lines in .zkignore file. They are applied to full relative
+path of walked files.
+
=head1 HISTORY
Older version of that script, written on Z shell, can be found in Git history.
my %cats;
{
+ my @ignores;
+ if (-e ".zkignore") {
+ open my $fh, "<", ".zkignore" or die "$!";
+ while (<$fh>) {
+ chop;
+ push @ignores, $_;
+ }
+ close $fh;
+ }
+ sub isignored {
+ my $p = shift;
+ foreach my $re (@ignores) {
+ return 1 if $p =~ m/$re/;
+ }
+ return 0;
+ }
use File::Find;
use POSIX qw(strftime);
sub wanted {
my $fn = $_;
+ return if $fn =~ /^\./;
my $pth = $File::Find::name;
$pth =~ s/^\.\/?//;
if (-d $fn) {
+ return if isignored "$pth/";
opendir(my $dh, $fn) or die "$!";
my @entries;
while (readdir $dh) {
if (-d "$fn/$_") {
$_ .= "/";
}
+ next if isignored(($fn eq ".") ? $_ : "$fn/$_");
push @entries, $_;
}
closedir $dh;
$cats{$pth} = \@entries;
} else {
+ return if isignored $pth;
my @s = stat($fn) or die "$!";
$sizes{$pth} = $s[7];
$mtimes{$pth} = strftime "%Y-%m-%d %H:%M:%S", gmtime $s[9];