|
NAMEFile::ChangeNotify::Event - Class for file change eventsVERSIONversion 0.31SYNOPSISmy $watcher = File::ChangeNotify->instantiate_watcher( directories => [ '/my/path', '/my/other' ], filter => qr/\.(?:pm|conf|yml)$/, exclude => [ 't', 'root', qr(/(?!\.)[^/]+$) ], ); for my $event ( $watcher->new_events ) { print $event->path, ' - ', $event->type, "\n"; } DESCRIPTIONThis class provides information about a change to a specific file or directory.METHODSFile::ChangeNotify::Event->new(...)This method creates a new event. It accepts the following arguments:
$event->pathReturns the path of the changed file or directory.$event->typeReturns the type of event.$event->has_attributesThis returns true for modify events which include information about a path's attribute changes.$event->attributesIf the event includes information about changes to a path's attributes, then this returns a two-element arrayref. Each element is in turn a hashref which will contain at least one of the following keys:
Note that only keys which changed will be included. $event->has_contentThis returns true for modify events which include information about a file's content.$event->contentThis returns a two-element arrayref where the first element is the old content and the second is the new content.Note that this content is stored as bytes, not UTF-8. You will need to explicitly call "Encode::decode" on the content to make it UTF-8. This is done because there's no reason you couldn't use this feature with file's containing any sort of binary data. SUPPORTBugs may be submitted at <http://rt.cpan.org/Public/Dist/Display.html?Name=File-ChangeNotify> or via email to bug-file-changenotify@rt.cpan.org <mailto:bug-file-changenotify@rt.cpan.org>.I am also usually active on IRC as 'autarch' on "irc://irc.perl.org". SOURCEThe source code repository for File-ChangeNotify can be found at <https://github.com/houseabsolute/File-ChangeNotify>.AUTHORDave Rolsky <autarch@urth.org>COPYRIGHT AND LICENSEThis 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.
Visit the GSP FreeBSD Man Page Interface. |