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