line |
true |
false |
branch |
37
|
0 |
0 |
if $_[0] eq 'File::Hotfolder' |
38
|
0 |
0 |
@_ % 2 ? : |
46
|
0 |
0 |
if $args{'fullname'} |
62
|
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'}, 'fork', !!$args{'fork'}, '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'}), 'event_mask', $args{'event_mask'} || 136}, $class) |
72
|
0 |
0 |
if ref $catch // !1 |
73
|
0 |
0 |
$catch ? : |
78
|
0 |
0 |
unless $filter |
79
|
0 |
0 |
if ref $filter eq ref qr// |
89
|
0 |
0 |
if (-d $_) { } |
|
0 |
0 |
elsif (not $is_root or $self->{'scan'}) { } |
98
|
0 |
0 |
if ($self->{'filter_dir'}) |
99
|
0 |
0 |
unless $self->{'filter_dir'}->(basename($path)) |
113
|
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->mask & $self->{'event_mask'}) {
$self->_callback($path);
};
}
)) |
120
|
0 |
0 |
if ($e->IN_Q_OVERFLOW) |
124
|
0 |
0 |
if ($e->IN_ISDIR) { } |
|
0 |
0 |
elsif ($e->mask & $self->{'event_mask'}) { } |
125
|
0 |
0 |
if ($e->IN_CREATE or $e->IN_MOVED_TO) { } |
|
0 |
0 |
elsif ($e->IN_DELETE_SELF or $e->IN_MOVE_SELF) { } |
144
|
0 |
0 |
if ($self->{'filter'} and not $self->{'filter'}->($path)) |
148
|
0 |
0 |
$self->{'fork'} ? : |
149
|
0 |
0 |
if $fork |
154
|
0 |
0 |
if ($self->{'catch'}) { } |
156
|
0 |
0 |
if ($@) |
165
|
0 |
0 |
if ($status and $self->{'delete'}) { } |
172
|
0 |
0 |
if defined $fork and not $fork |
205
|
0 |
0 |
if (not defined $logger) { } |
|
0 |
0 |
elsif (&blessed($logger) and $logger->can('log')) { } |
|
0 |
0 |
elsif (ref $logger // !1) { } |
208
|
0 |
0 |
$args{'event'} & 96 ? : |
217
|
0 |
0 |
$args{'event'} & 96 ? : |
228
|
0 |
0 |
if ($event & $self->{'print'}) |