Skip Menu |

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: 72849
Status: resolved
Priority: 0/
Queue: AnyEvent-Filesys-Notify

People
Owner: Nobody in particular
Requestors: mail [...] miguelgodinho.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: (no value)



Subject: warnings with broken symbolic links
Under ext4, scanning a directory with a broken symlink leads to a warning: ``` Use of uninitialized value in numeric ne (!=) at Notify.pm line 118 Use of uninitialized value in numeric ne (!=) at Notify.pm line 119 ``` the reason seems to be that, for those cases, '@stat' in the the function '_stat' is empty '()' and, consequently, the keys 'mtype' and 'size' take undefined values. a quick-n-dirty patch for Notify.pm is attached. Environment: This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi Debian 6.0.3 (ext4 partition)
Subject: notify.patch
72,73c72,73 < my %files = map { $_ => 1 } File::Find::Rule->in(@paths); < %files = map { abs_path($_) => _stat($_) } keys %files; --- > # (i didn't get it...) > my @files = File::Find::Rule->in(@paths); 75c75,84 < return \%files; --- > my $fs_stats = {}; > foreach my $file_path (@files) { > # _stat() returns undef if no stats can be retrieved, > # as with broken symlinks under ext4 (and possibly others). > if (my $file_stats = _stat($file_path)) { > $fs_stats->{abs_path($file_path)} = $file_stats; > } > } > > return $fs_stats; 123a133,134 > # Returns undefined if no stats can be retrieved, as it happens with broken > # symlinks (at least under ext4). 127,134c138,147 < my @stat = stat $path; < return { < path => $path, < mtime => $stat[9], < size => $stat[7], < is_dir => -d _, < }; < --- > if (my @stat = stat $path ) { > return { > path => $path, > mtime => $stat[9], > size => $stat[7], > is_dir => -d _, > }; > } else { > return undef; > } 215c228 < given directories and execute a callback when a modification is detected. --- > given directories and execute a callback when a modification is detected. 222c235 < =item dirs --- > =item dirs 263c276 < encouraged as the L</Fallback> implement is very inefficient, but it --- > encouraged as the L</Fallback> implement is very inefficient, but it 308,309c321,322 < This is not slight against the authors of those modules. Both are well < respected, are certainly finer coders than I am, and built modules which --- > This is not slight against the authors of those modules. Both are well > respected, are certainly finer coders than I am, and built modules which
Subject: Re: [rt.cpan.org #72849] warnings with broken symbolic links
Date: Wed, 14 Dec 2011 17:31:44 -0500
To: bug-AnyEvent-Filesys-Notify [...] rt.cpan.org
From: Mark Grimes <mgrimes [...] cpan.org>
Thanks for the bug report. It took a bit of work to reproduce the problem, but I was eventually able to. Your patch was a big help as well. I am releasing a new version now (0.06).
Release v0.06 addressed this issue. Thanks.