GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
File::ChangeNotify::Event(3) User Contributed Perl Documentation File::ChangeNotify::Event(3)

File::ChangeNotify::Event - Class for file change events

version 0.31

    my $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";
    }

This class provides information about a change to a specific file or directory.

This method creates a new event. It accepts the following arguments:
  • path => $path

    The full path to the file or directory that changed.

  • type => $type

    The type of event. This must be one of "create", "modify", "delete", or "unknown".

Returns the path of the changed file or directory.

Returns the type of event.

This returns true for modify events which include information about a path's attribute changes.

If 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:
  • permissions

    The permissions mask for the path.

  • uid

    The user id that owns the path.

  • gid

    The group id that owns the path.

Note that only keys which changed will be included.

This returns true for modify events which include information about a file's content.

This 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.

Bugs 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".

The source code repository for File-ChangeNotify can be found at <https://github.com/houseabsolute/File-ChangeNotify>.

Dave Rolsky <autarch@urth.org>

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.

2019-01-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.