Subject: | Doesn't pickup changes in newly created directories with Linux::Inotify2 |
First, nice module. Thanks for releasing it.
When using Linux::Inotify2, changes to newly created sub directories of
a watched directory are not reported.
For example, if we are watching /tmp/one and we mkdir /tmp/one/sub, we
get a event. If we then create /tmp/one/sub/file, no notification is sent.
See the attached script for an example of this. It works fine for
Mac::FSEvents. I'm not sure about the simple scan implementation.
Thanks,
Mark
Subject: | fns-fail.pl |
#!/usr/bin/env perl
use Modern::Perl;
use Filesys::Notify::Simple;
use Data::Dump;
use File::Temp qw(tempdir);
our $dir = tempdir( CLEANUP => 1 );
if( fork ){
my $watcher = Filesys::Notify::Simple->new( [$dir] );
say "Entering watch loop";
$watcher->wait( sub { dd 'Event: ', $_ for @_; } ) while 1;
}
sleep 1;
# Reported
mkdir "$dir/sub" or die;
# Not reported
open my $fh, '>', "$dir/sub/file" or die;
print $fh "hi\n";
close $fh;
# Reported
open $fh, '>', "$dir/file" or die;
print $fh "hi\n";
close $fh;