Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Filesys-Notify-Simple CPAN distribution.

Report information
The Basics
Id: 52652
Status: open
Priority: 0/
Queue: Filesys-Notify-Simple

People
Owner: Nobody in particular
Requestors: mgrimes [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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;
Subject: Re: [rt.cpan.org #52652] Doesn't pickup changes in newly created directories with Linux::Inotify2
Date: Thu, 10 Dec 2009 09:18:48 -0800
To: bug-Filesys-Notify-Simple [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
Does that work with File::ChangeNotify using Inotify2? On Thu, Dec 10, 2009 at 9:16 AM, Mark Grimes via RT <bug-Filesys-Notify-Simple@rt.cpan.org> wrote: Show quoted text
> Thu Dec 10 12:16:23 2009: Request 52652 was acted upon. > Transaction: Ticket created by MGRIMES >       Queue: Filesys-Notify-Simple >     Subject: Doesn't pickup changes in newly created directories with >  Linux::Inotify2 >   Broken in: (no value) >    Severity: Important >       Owner: Nobody >  Requestors: mgrimes@cpan.org >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=52652 > > > > 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 > > #!/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; > >
-- Tatsuhiko Miyagawa
Subject: Re: [rt.cpan.org #52652] Doesn't pickup changes in newly created directories with Linux::Inotify2
Date: Thu, 10 Dec 2009 12:23:50 -0500
To: bug-Filesys-Notify-Simple [...] rt.cpan.org
From: Mark Grimes <mgrimes [...] cpan.org>
I believe so. I'm pretty sure ChangeNotify adds newly created directories to the watch list. On Thu, Dec 10, 2009 at 12:19 PM, miyagawa@gmail.com via RT < bug-Filesys-Notify-Simple@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=52652 > > > Does that work with File::ChangeNotify using Inotify2? > > On Thu, Dec 10, 2009 at 9:16 AM, Mark Grimes via RT > <bug-Filesys-Notify-Simple@rt.cpan.org> wrote:
> > Thu Dec 10 12:16:23 2009: Request 52652 was acted upon. > > Transaction: Ticket created by MGRIMES > > Queue: Filesys-Notify-Simple > > Subject: Doesn't pickup changes in newly created directories with > > Linux::Inotify2 > > Broken in: (no value) > > Severity: Important > > Owner: Nobody > > Requestors: mgrimes@cpan.org > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=52652 > > > > > > > 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 > > > > #!/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; > > > >
> > > > -- > Tatsuhiko Miyagawa > >
Subject: Re: [rt.cpan.org #52652] Doesn't pickup changes in newly created directories with Linux::Inotify2
Date: Thu, 10 Dec 2009 09:35:59 -0800
To: bug-Filesys-Notify-Simple [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
Oh, I see. Patches are welcome :) On Thu, Dec 10, 2009 at 9:24 AM, Mark Grimes via RT <bug-Filesys-Notify-Simple@rt.cpan.org> wrote: Show quoted text
>       Queue: Filesys-Notify-Simple >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=52652 > > > I believe so. I'm pretty sure ChangeNotify adds newly created directories to > the watch list. > > > On Thu, Dec 10, 2009 at 12:19 PM, miyagawa@gmail.com via RT < > bug-Filesys-Notify-Simple@rt.cpan.org> wrote: >
>> <URL: http://rt.cpan.org/Ticket/Display.html?id=52652 > >> >> Does that work with File::ChangeNotify using Inotify2? >> >> On Thu, Dec 10, 2009 at 9:16 AM, Mark Grimes via RT >> <bug-Filesys-Notify-Simple@rt.cpan.org> wrote:
>> > Thu Dec 10 12:16:23 2009: Request 52652 was acted upon. >> > Transaction: Ticket created by MGRIMES >> >       Queue: Filesys-Notify-Simple >> >     Subject: Doesn't pickup changes in newly created directories with >> >  Linux::Inotify2 >> >   Broken in: (no value) >> >    Severity: Important >> >       Owner: Nobody >> >  Requestors: mgrimes@cpan.org >> >      Status: new >> >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=52652 > >> > >> > >> > 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 >> > >> > #!/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; >> > >> >
>> >> >> >> -- >> Tatsuhiko Miyagawa >> >>
> > > I believe so. I'm pretty sure ChangeNotify adds newly created directories to the watch list. > > > On Thu, Dec 10, 2009 at 12:19 PM, miyagawa@gmail.com via RT <bug-Filesys-Notify-Simple@rt.cpan.org> wrote:
>> >> <URL: http://rt.cpan.org/Ticket/Display.html?id=52652 > >> >> Does that work with File::ChangeNotify using Inotify2? >> >> On Thu, Dec 10, 2009 at 9:16 AM, Mark Grimes via RT >> <bug-Filesys-Notify-Simple@rt.cpan.org> wrote:
>> > Thu Dec 10 12:16:23 2009: Request 52652 was acted upon. >> > Transaction: Ticket created by MGRIMES >> >       Queue: Filesys-Notify-Simple >> >     Subject: Doesn't pickup changes in newly created directories with >> >  Linux::Inotify2 >> >   Broken in: (no value) >> >    Severity: Important >> >       Owner: Nobody >> >  Requestors: mgrimes@cpan.org >> >      Status: new >> >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=52652 > >> > >> > >> > 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 >> > >> > #!/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; >> > >> >
>> >> >> >> -- >> Tatsuhiko Miyagawa >>
> > >
-- Tatsuhiko Miyagawa
From: carlosnunomota [...] gmail.com
Fixed this by changing wait_inotify2 to: sub wait_inotify2 { my @path = @_; Linux::Inotify2->import; my $inotify = Linux::Inotify2->new; my $fs = _full_scan(@path); for my $path (keys %$fs) { $inotify->watch($path, &IN_MODIFY|&IN_CREATE|&IN_DELETE|&IN_DELETE_SELF|&IN_MOVE_SELF); } return sub { my $cb = shift; $inotify->blocking(1); my @events = $inotify->read; for (@events) { if (-d $_->fullname) { $inotify->watch($_->fullname, &IN_MODIFY|&IN_CREATE|&IN_DELETE|&IN_DELETE_SELF|&IN_MOVE_SELF); } } $cb->(map { +{ path => $_->fullname } } @events); }; } On Thu Dec 10 12:16:23 2009, MGRIMES wrote: Show quoted text
> 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
From: carlosnunomota [...] gmail.com
Sorry this makes more sense sub wait_inotify2 { my @path = @_; Linux::Inotify2->import; my $inotify = Linux::Inotify2->new; my $fs = _full_scan(@path); for my $path (keys %$fs) { $inotify->watch($path, &IN_MODIFY|&IN_CREATE|&IN_DELETE|&IN_DELETE_SELF|&IN_MOVE_SELF); } return sub { my $cb = shift; $inotify->blocking(1); my @events = $inotify->read; for (@events) { if (-d $_->fullname && $_->IN_CREATE) { $inotify->watch($_->fullname, &IN_MODIFY|&IN_CREATE|&IN_DELETE|&IN_DELETE_SELF|&IN_MOVE_SELF); } } $cb->(map { +{ path => $_->fullname } } @events); }; } On Thu Feb 02 07:50:10 2012, cnmota wrote: Show quoted text
> Fixed this by changing wait_inotify2 to: > > sub wait_inotify2 { > my @path = @_; > > Linux::Inotify2->import; > my $inotify = Linux::Inotify2->new; > > my $fs = _full_scan(@path); > for my $path (keys %$fs) { > $inotify->watch($path, > &IN_MODIFY|&IN_CREATE|&IN_DELETE|&IN_DELETE_SELF|&IN_MOVE_SELF); > } > > return sub { > my $cb = shift; > $inotify->blocking(1); > my @events = $inotify->read; > > for (@events) { > if (-d $_->fullname) { > $inotify->watch($_->fullname, > &IN_MODIFY|&IN_CREATE|&IN_DELETE|&IN_DELETE_SELF|&IN_MOVE_SELF); > } > } > > $cb->(map { +{ path => $_->fullname } } @events); > }; > } > > On Thu Dec 10 12:16:23 2009, MGRIMES wrote:
> > 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. Show quoted text
> > > > 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
>