| 1 |
NAME |
| 2 |
|
| 3 |
Filesys::Notify::Simple - Simple and dumb file system watcher |
| 4 |
|
| 5 |
SYNOPSIS |
| 6 |
|
| 7 |
use Filesys::Notify::Simple; |
| 8 |
|
| 9 |
my $watcher = Filesys::Notify::Simple->new([ "." ]); |
| 10 |
$watcher->wait(sub { |
| 11 |
for my $event (@_) { |
| 12 |
$event->{path} # full path of the file updated |
| 13 |
} |
| 14 |
}); |
| 15 |
|
| 16 |
DESCRIPTION |
| 17 |
|
| 18 |
Filesys::Notify::Simple is a simple but unified interface to get |
| 19 |
notifications of changes to a given filesystem path. It utilizes |
| 20 |
inotify2 on Linux, fsevents on OS X, kqueue on FreeBSD and |
| 21 |
FindFirstChangeNotification on Windows if they're installed, with a |
| 22 |
fallback to the full directory scan if they're not available. |
| 23 |
|
| 24 |
There are some limitations in this module. If you don't like it, use |
| 25 |
File::ChangeNotify. |
| 26 |
|
| 27 |
* There is no file name based filter. Do it in your own code. |
| 28 |
|
| 29 |
* You can not get types of events (created, updated, deleted). |
| 30 |
|
| 31 |
* Currently wait method blocks. |
| 32 |
|
| 33 |
In return, this module doesn't depend on any non-core modules. Platform |
| 34 |
specific optimizations with Linux::Inotify2, Mac::FSEvents, |
| 35 |
Filesys::Notify::KQueue and Win32::ChangeNotify are truely optional. |
| 36 |
|
| 37 |
NOTE: Using Win32::ChangeNotify may put additional limitations. |
| 38 |
|
| 39 |
* Win32::ChangeNotify uses FindFirstChangeNotificationA so that |
| 40 |
Unicode characters can not be handled. On cygwin (1.7 or later), |
| 41 |
Unicode characters should be able to be handled when |
| 42 |
Win32::ChangeNotify is not used. |
| 43 |
|
| 44 |
* If more than 64 directories are included under the specified paths, |
| 45 |
an error occurrs. |
| 46 |
|
| 47 |
AUTHOR |
| 48 |
|
| 49 |
Tatsuhiko Miyagawa <[email protected]> |
| 50 |
|
| 51 |
LICENSE |
| 52 |
|
| 53 |
This library is free software; you can redistribute it and/or modify it |
| 54 |
under the same terms as Perl itself. |
| 55 |
|
| 56 |
SEE ALSO |
| 57 |
|
| 58 |
File::ChangeNotify Mac::FSEvents Linux::Inotify2 |
| 59 |
Filesys::Notify::KQueue Win32::ChangeNotify |
| 60 |
|