|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: inotify problemby Perlbotics (Monsignor) |
| on Jun 05, 2012 at 21:33 UTC ( #974576=note: print w/ replies, xml ) | Need Help?? |
|
Same here (SuSE 11.4, Perl 5.14.1, Linux::Inotify2 V1.22) - works. As AM already said, it depends on how you change the file and if you rename the original file during the process. Try the following changes, run stat file_to_watch before and after your experiment.
E.g., if I mix edit the file using Emacs and echo, the program stops reporting changes. If I append to the Emacs backup file (file_to_watch~) the modifications are reported again. The original file is watched, regardless of the fact that it has been renamed. You could monitor the (file-name-)changes (IN_MOVE_SELF) and just re-init the watcher to keep track of further changes applied to the file identified by its name, not by its inode.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||