| line |
true |
false |
branch |
|
38
|
0 |
0 |
if $_[0] eq 'File::Hotfolder' |
|
39
|
0 |
0 |
@_ % 2 ? : |
|
47
|
0 |
0 |
if $args{'fullname'} |
|
57
|
0 |
0 |
unless -d $path, my $self = bless({'inotify', 'Linux::Inotify2'->new || croak("Unable to create new inotify object: $!"), 'callback', $args{'callback'} || sub {
1;
}
, 'delete', !!$args{'delete'}, 'print', 0 + ($args{'print'} || 0), 'filter', _build_filter($args{'filter'}, sub {
not $_[0] =~ qr"^(.*/)?\.[^/]*$";
}
), 'filter_dir', _build_filter($args{'filter_dir'}, qr/^[^.]|^.$/), 'scan', $args{'scan'}, 'catch', _build_catch($args{'catch'}), 'logger', _build_logger($args{'logger'})}, $class) |
|
71
|
0 |
0 |
if ref $catch // !1 |
|
72
|
0 |
0 |
$catch ? : |
|
77
|
0 |
0 |
unless $filter |
|
78
|
0 |
0 |
if ref $filter eq ref qr// |
|
88
|
0 |
0 |
if (-d $_) { } |
|
|
0 |
0 |
elsif ($$self{'scan'}) { } |
|
97
|
0 |
0 |
if ($$self{'filter_dir'}) |
|
98
|
0 |
0 |
unless $$self{'filter_dir'}(basename($path)) |
|
112
|
0 |
0 |
unless ($self->inotify->watch($path, 4040, sub {
my $e = shift();
my $path = $e->fullname;
if ($e->IN_Q_OVERFLOW) {
$self->log(64, $path, 'event queue overflowed');
};
if ($e->IN_ISDIR) {
if ($e->IN_CREATE or $e->IN_MOVED_TO) {
$self->watch_recursive($path);
}
elsif ($e->IN_DELETE_SELF or $e->IN_MOVE_SELF) {
$self->log(2, $path);
$e->w->cancel;
};
}
elsif ($e->IN_CLOSE_WRITE or $e->IN_MOVED_TO) {
$self->_callback($path);
};
}
)) |
|
119
|
0 |
0 |
if ($e->IN_Q_OVERFLOW) |
|
123
|
0 |
0 |
if ($e->IN_ISDIR) { } |
|
|
0 |
0 |
elsif ($e->IN_CLOSE_WRITE or $e->IN_MOVED_TO) { } |
|
124
|
0 |
0 |
if ($e->IN_CREATE or $e->IN_MOVED_TO) { } |
|
|
0 |
0 |
elsif ($e->IN_DELETE_SELF or $e->IN_MOVE_SELF) { } |
|
143
|
0 |
0 |
if ($$self{'filter'} and not $$self{'filter'}($path)) |
|
150
|
0 |
0 |
if ($$self{'catch'}) { } |
|
152
|
0 |
0 |
if ($@) |
|
161
|
0 |
0 |
if ($status and $$self{'delete'}) { } |
|
199
|
0 |
0 |
if (not defined $logger) { } |
|
|
0 |
0 |
elsif (blessed $logger and $logger->can('log')) { } |
|
|
0 |
0 |
elsif (ref $logger // !1) { } |
|
202
|
0 |
0 |
$args{'event'} & 96 ? : |
|
208
|
0 |
0 |
$args{'event'} & 96 ? : |
|
222
|
0 |
0 |
if ($event & $$self{'print'}) |