Filesys...::Simple(3)

Okay bestie, welcome to the Filesys::Notify::Simple page from the User Contributed Perl Documentation ๐Ÿ’… โ€” youโ€™ll find it filed under Filesys...::Simple(3), and itโ€™s literally a simple and dumb file system watcher. Letโ€™s get into it โœจ

๐ŸŒธ NAME ๐ŸŒธ

Filesys::Notify::Simple โ€” a simple and dumb file system watcher ๐ŸŽ€

โœจ SYNOPSIS โœจ

Hereโ€™s the whole vibe, copied exactly so you can steal it:

use Filesys::Notify::Simple;

my $watcher = Filesys::Notify::Simple->new([ "." ]);
$watcher->wait(sub {
    for my $event (@_) {
        $event->{path} # full path of the file updated
    }
});

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So Filesys::Notify::Simple is a simple but unified interface to get notifications of changes to a given filesystem path. It utilizes inotify2 on Linux, fsevents on OS X, kqueue on FreeBSD, and FindFirstChangeNotification on Windows if theyโ€™re installed, with a fallback to the full directory scan if theyโ€™re not available ๐Ÿ”ฅ

There are some limitations in this module. If you donโ€™t like it, use File::ChangeNotify โ€” thatโ€™s the official escape hatch ๐Ÿซถ

  • There is no file name based filter โ€” do it in your own code, bestie.
  • You can not get types of events (created, updated, deleted).
  • Currently the wait method blocks.

In return, this module doesnโ€™t depend on any non-core modules โ€” periodt ๐Ÿ’… Platform specific optimizations with Linux::Inotify2, Mac::FSEvents, Filesys::Notify::KQueue and Win32::ChangeNotify are truely optional. Like, for real optional โœจ

NOTE: Using Win32::ChangeNotify may put additional limitations.
  • Win32::ChangeNotify uses FindFirstChangeNotificationA so that Unicode characters can not be handled. On cygwin (1.7 or later), Unicode characters should be able to be handled when Win32::ChangeNotify is not used.
  • If more than 64 directories are included under the specified paths, an error occurrs.

๐Ÿซถ AUTHOR ๐Ÿซถ

The icon behind this module is Tatsuhiko Miyagawa <miyagawa@bulknews.net> ๐Ÿ’–

๐Ÿ‘‘ LICENSE ๐Ÿ‘‘

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

Go give these a little look if youโ€™re feeling nosy ๐Ÿ‘€

  • File::ChangeNotify
  • Mac::FSEvents
  • Linux::Inotify2
  • Filesys::Notify::KQueue
  • Win32::ChangeNotify

Later, bestie! ๐Ÿ’œ This page is from the Filesys...::Simple(3) manual, with perl v5.42.0, dated 2020-01-04 โœจ

๐Ÿ“ฆ where this page comes from