Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id:
80156
Status:
resolved
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
florian.koch1981 [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: Support for more events like IN_ATTRIB
Date: Fri, 12 Oct 2012 22:04:58 +0200
To: bug-AnyEvent-Filesys-Notify@rt.cpan.org
From: Florian Koch <florian.koch1981@gmail.com>
Hi, i try to add the IN_ATTRIB event to this nice Perl Module, i have try to add the flag in the Linux Role to the other flags for the attributes, but this won't work:
Show quoted text
> --snip-- > $inotify->watch( > $dir, > IN_MODIFY | IN_CREATE | IN_DELETE | IN_DELETE_SELF | > IN_MOVE | IN_MOVE_SELF | IN_ATTRIB, > sub { my $e = shift; $self->_process_events($e); } ); > } > ---snip--- > $self->_fs_monitor->watch( > $event->path, > IN_MODIFY | IN_CREATE | IN_DELETE | IN_DELETE_SELF | > IN_MOVE | IN_MOVE_SELF | IN_ATTRIB, > sub { my $e = shift; $self->_process_events($e); } );
How can i add these event? regards flo perl-AnyEvent-Filesys-Notify 0.07 uname -a Linux xxx 2.6.32-220.17.1.el6.x86_64 #1 SMP Tue May 15 17:16:46 CDT 2012 x86_64 x86_64 x86_64 GNU/Linux perl -V Summary of my perl5 (revision 5 version 10 subversion 1) configuration: Platform: osname=linux, osvers=2.6.32-131.12.1.el6.x86_64, archname=x86_64-linux-thread-multi uname='linux sl6.fnal.gov 2.6.32-131.12.1.el6.x86_64 #1 smp tue aug 23 11:13:45 cdt 2011 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DDEBUGGING=-g -Dversion=5.10.1 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Darchlib=/usr/lib64/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib64/perl5/vendor_perl -Dinc_version_list=5.10.0 -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.4.5 20110214 (Red Hat 4.4.5-6)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -fstack-protector' libpth=/usr/local/lib64 /lib64 /usr/lib64 libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.12' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Nov 3 2011 16:45:47 @INC: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5
Subject: Re: [rt.cpan.org #80156] Support for more events like IN_ATTRIB
Date: Sat, 13 Oct 2012 13:32:51 +0200
To: bug-AnyEvent-Filesys-Notify@rt.cpan.org
From: Florian Koch <florian.koch1981@gmail.com>
ok i have found it, it needs more patching, here is the diff

diff --git a/lib/AnyEvent/Filesys/Notify.pm b/lib/AnyEvent/Filesys/Notify.pm
index a2ab8de..95c1ef8 100644
--- a/lib/AnyEvent/Filesys/Notify.pm
+++ b/lib/AnyEvent/Filesys/Notify.pm
@@ -121,6 +121,7 @@ sub _is_path_modified {
     return   if $new_path->{is_dir};
     return 1 if $new_path->{mtime} != $old_path->{mtime};
     return 1 if $new_path->{size} != $old_path->{size};
+    return 1 if $new_path->{mode} != $old_path->{mode};
     return;
 }
 
@@ -138,6 +139,7 @@ sub _stat {
         path   => $path,
         mtime  => $stat[9],
         size   => $stat[7],
+        mode   => $stat[2],
         is_dir => -d _,
     };
 
diff --git a/lib/AnyEvent/Filesys/Notify/Role/Linux.pm b/lib/AnyEvent/Filesys/Notify/Role/Linux.pm
index 35ddcc9..3be9e3d 100644
--- a/lib/AnyEvent/Filesys/Notify/Role/Linux.pm
+++ b/lib/AnyEvent/Filesys/Notify/Role/Linux.pm
@@ -25,7 +25,7 @@ sub _init {
         $inotify->watch(
             $dir,
             IN_MODIFY | IN_CREATE | IN_DELETE | IN_DELETE_SELF |
-              IN_MOVE | IN_MOVE_SELF,
+              IN_MOVE | IN_MOVE_SELF | IN_ATTRIB,
             sub { my $e = shift; $self->_process_events($e); } );
     }
 
@@ -55,7 +55,7 @@ around '_process_events' => sub {
         $self->_fs_monitor->watch(
             $event->path,
             IN_MODIFY | IN_CREATE | IN_DELETE | IN_DELETE_SELF |
-                IN_MOVE | IN_MOVE_SELF,
+                IN_MOVE | IN_MOVE_SELF | IN_ATTRIB,
             sub { my $e = shift; $self->_process_events($e); } );
 
     }
Thanks for the bug report and patch. I've made a few tweaks to catch changes to directory attribs and added tests. Should be on github and cpan shortly. v0.08.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.