File::...Notify(3pm)

πŸ“¦
version 0.31 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– NAME πŸ’–

File::ChangeNotify β€” watch for changes to files, cross-platform style, bestie ✨

Oh and btw this page lives in the User Contributed Perl Documentation section, section 3pm, which is the whole reason the header is like that. iykyk πŸ’…


🌸 VERSION 🌸

version 0.31 β€” she's grown, she's thriving πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the vibe:

use File::ChangeNotify;

my $watcher =
    File::ChangeNotify->instantiate_watcher
        ( directories => [ '/my/path', '/my/other' ],
          filter      => qr/\.(?:pm|conf|yml)$/,
        );

if ( my @events = $watcher->new_events ) { ... }

# blocking
while ( my @events = $watcher->wait_for_events ) { ... }

literally two ways to do the thing: peek at what's new with new_events, or just sit there and wait for stuff to happen with wait_for_events. the second one blocks. she will simply Not move until something changes. main character energy honestly πŸ‘‘


✨ DESCRIPTION ✨

so what this module does is hand you an API for building a File::ChangeNotify::Watcher subclass that actually works on your platform. cross-platform? yes ma'am. no cap. 🌈

pro tip from me to you: most of the actual documentation for this distro is over in File::ChangeNotify::Watcher. this page is the lil intro, that page is the whole story. don't come for me, go read it 🫢

πŸ’… METHODS πŸ’…

this class provides the following methods, and yes, they're both cute:

🌟 File::ChangeNotify->instantiate_watcher(...)

this method goes shopping through every available subclass of File::ChangeNotify::Watcher and instantiates the first one it can load, using the arguments you handed it. obsessed with the efficiency.

and here's the little quirk that makes her iconic: it always tries File::ChangeNotify::Watcher::Default last, because the assumption is that any other class that's available is a better option. so Default is literally the last-resort friend you text at 2am. sorry babe, it's true πŸ’€

🌟 File::ChangeNotify->usable_classes

returns a list of all the loadable File::ChangeNotify::Watcher subclasses β€” except File::ChangeNotify::Watcher::Default, which gets left off the list because she is always usable. she's the baseline. the blueprint. the moment. πŸ‘‘


πŸŽ€ SUPPORT πŸŽ€

got bugs? (not the cute kind 😭) you can submit them at:

http://rt.cpan.org/Public/Dist/Display.html?Name=File-ChangeNotify

or email them over to bug-file-changenotify@rt.cpan.org β€” like, mailto:bug-file-changenotify@rt.cpan.org if you're fancy.

also!! the author is usually active on IRC as 'autarch' on irc://irc.perl.org. come say hi fr fr 🫢


⭐ SOURCE ⭐

the source code repository for File-ChangeNotify lives at:

https://github.com/houseabsolute/File-ChangeNotify

go peek, go star it, go be nosy. that's the whole point of this module anyway πŸ’–


πŸ’œ DONATIONS πŸ’œ

okay so if you'd like to thank the author for the work done on this module, please consider making a "donation" via PayPal. he spends a lot of free time creating free software and would appreciate any support you'd care to offer. πŸ₯Ί

but also, please note: he is not suggesting that you must do this in order for him to continue working on this particular software. he will continue to do so, inasmuch as he has in the past, for as long as it interests him. periodt.

similarly β€” and this is important β€” a donation made this way will probably not make him work on this software much more, unless he gets so many donations that he can consider working on free software full time. (let's all have a chuckle at that together 😭)

to donate: log into PayPal and send money to autarch@urth.org, or use the button at http://www.urth.org/~autarch/fs-donation.html.


πŸ‘‘ AUTHOR πŸ‘‘

Dave Rolsky <autarch@urth.org>


🧚 CONTRIBUTORS 🧚

  • Aaron Crane <arc@cpan.org>
  • H. Merijn Branch <h.m.brand@xs4all.nl>
  • Karen Etheridge <ether@cpan.org>

absolute icons, all three of them πŸ’–


This software is Copyright (c) 2009 - 2019 by Dave Rolsky.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

The full text of the license can be found in the LICENSE file included with this distribution. go read it bestie, it's good for you πŸ“


and that's the whole page!! mwah πŸ’‹

this lil beauty is from perl v5.36.0, dated 2022-12-04, and yes she's a File::...Notify(3pm) page β€” k bye, go watch some files change πŸ¦‹βœ¨

πŸ“¦ where this page comes from