AnyEvent-Filesys-Notify
view release on metacpan or search on metacpan
This is retained for backward compatibility. Using "backend ="
'Fallback'> is preferred. Force the use of the "Fallback" watcher
implementation. This is not encouraged as the "Fallback" implement
is very inefficient, but it does not require either Linux::INotify2
nor Mac::FSEvents. Optional.
parse_events
parse_events => 1,
In backends that support it (currently INotify2), parse the events
instead of rescanning file system for changed "stat()" information.
Note, that this might cause slight changes in behavior. In
particular, the Inotify2 backend will generate an additional
'modified' event when a file changes (once when opened for write,
and once when modified).
skip_subdirs
skip_subdirs => 1,
Skips subdirectories and anything in them while building a list of
files/dirs to watch. Optional.
This is retained for backward compatibility. Using `backend =` 'Fallback'>
is preferred. Force the use of the ["Fallback"](#fallback) watcher implementation. This is
not encouraged as the ["Fallback"](#fallback) implement is very inefficient, but it does
not require either [Linux::INotify2](https://metacpan.org/pod/Linux::INotify2) nor [Mac::FSEvents](https://metacpan.org/pod/Mac::FSEvents). Optional.
- parse\_events
parse_events => 1,
In backends that support it (currently INotify2), parse the events instead of
rescanning file system for changed `stat()` information. Note, that this might
cause slight changes in behavior. In particular, the Inotify2 backend will
generate an additional 'modified' event when a file changes (once when opened
for write, and once when modified).
- skip\_subdirs
skip_subdirs => 1,
Skips subdirectories and anything in them while building a list of files/dirs
to watch. Optional.
lib/AnyEvent/Filesys/Notify.pm view on Meta::CPAN
my @paths = ref $args[0] eq 'ARRAY' ? @{ $args[0] } : @args;
my $fs_stats = {};
my $rule = Path::Iterator::Rule->new;
$rule->skip_subdirs(qr/./)
if (ref $self) =~ /^AnyEvent::Filesys::Notify/
&& $self->skip_subdirs;
my $next = $rule->iter(@paths);
while ( my $file = $next->() ) {
my $stat = $self->_stat($file)
or next; # Skip files that we can't stat (ie, broken symlinks on ext4)
$fs_stats->{ abs_path($file) } = $stat;
}
return $fs_stats;
}
sub _diff_fs {
my ( $self, $old_fs, $new_fs ) = @_;
my @events = ();
lib/AnyEvent/Filesys/Notify.pm view on Meta::CPAN
This is retained for backward compatibility. Using C<backend => 'Fallback'>
is preferred. Force the use of the L</Fallback> watcher implementation. This is
not encouraged as the L</Fallback> implement is very inefficient, but it does
not require either L<Linux::INotify2> nor L<Mac::FSEvents>. Optional.
=item parse_events
parse_events => 1,
In backends that support it (currently INotify2), parse the events instead of
rescanning file system for changed C<stat()> information. Note, that this might
cause slight changes in behavior. In particular, the Inotify2 backend will
generate an additional 'modified' event when a file changes (once when opened
for write, and once when modified).
=item skip_subdirs
skip_subdirs => 1,
Skips subdirectories and anything in them while building a list of files/dirs
to watch. Optional.
sub file_find_rule {
my (@args) = @_;
# Accept either an array of dirs or a array ref of dirs
my @paths = ref $args[0] eq 'ARRAY' ? @{ $args[0] } : @args;
my $fs_stats = {};
for my $file ( File::Find::Rule->in(@paths) ) {
my $stat = _stat($file)
or next; # Skip files that we can't stat (ie, broken symlinks on ext4)
$fs_stats->{ abs_path($file) } = $stat;
}
return $fs_stats;
}
sub path_iterator_rule {
my (@args) = @_;
# Accept either an array of dirs or a array ref of dirs
my @paths = ref $args[0] eq 'ARRAY' ? @{ $args[0] } : @args;
my $fs_stats = {};
my $rule = Path::Iterator::Rule->new;
my $next = $rule->iter(@paths);
while ( my $file = $next->() ) {
my $stat = _stat($file)
or next; # Skip files that we can't stat (ie, broken symlinks on ext4)
$fs_stats->{ abs_path($file) } = $stat;
}
return $fs_stats;
}
sub path_class_rule {
my (@args) = @_;
# Accept either an array of dirs or a array ref of dirs
my @paths = ref $args[0] eq 'ARRAY' ? @{ $args[0] } : @args;
my $fs_stats = {};
my $rule = Path::Class::Rule->new;
my $next = $rule->iter(@paths);
while ( my $file = $next->() ) {
my $stat = _stat($file)
or next; # Skip files that we can't stat (ie, broken symlinks on ext4)
$fs_stats->{ abs_path($file) } = $stat;
}
return $fs_stats;
}
sub _stat {
AnyEvent::Filesys::Notify->_stat(@_);
}
( run in 1.631 second using v1.01-cache-2.11-cpan-49f99fa48dc )