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
AnyEvent::Filesys::Notify::Event(3) User Contributed Perl Documentation AnyEvent::Filesys::Notify::Event(3)

AnyEvent::Filesys::Notify::Event - Object to report changes in the monitored filesystem

version 1.23

    use AnyEvent::Filesys::Notify;

    my $notifier = AnyEvent::Filesys::Notify->new(
        dir      => [ qw( this_dir that_dir ) ],
        interval => 2.0,    # Optional depending on underlying watcher
        cb       => sub {
            my (@events) = @_;

            for my $event (@events){
                process_created_file($event->path)  if $event->is_created;
                process_modified_file($event->path) if $event->is_modified;
                process_deleted_file($event->path)  if $event->is_deleted;
            }
        },
    );

Simple object to encapsulate information about the filesystem modifications.

    my $modified_file = $event->path();

Returns the path to the modified file. This is the path as given by the user, ie not modified by abs_path.

    my $modificaiton_type = $event->type();

Returns the type of change made to the file or directory. Will be one of "created", "modified", or "deleted".

    my $is_dir  = $event->is_dir();

Returns a true value if the path is a directory.

    do_something($event) if $event->is_created;

True if "$event->type eq 'created'".

    do_something($event) if $event->is_modified;

True if "$event->type eq 'modified'".

    do_something($event) if $event->is_deleted;

True if "$event->type eq 'deleted'".

AnyEvent::Filesys::Notify

Mark Grimes, <mgrimes@cpan.org>

  • Gasol Wu <gasol.wu@gmail.com> who contributed the BSD support for IO::KQueue
  • Dave Hayes <dave@jetcafe.org>
  • Carsten Wolff <carsten@wolffcarsten.de>
  • Ettore Di Giacinto (@mudler)
  • Martin Barth (@ufobat)

Source repository is at <https://github.com/mvgrimes/AnyEvent-Filesys-Notify>.

Please report any bugs or feature requests on the bugtracker website <http://github.com/mvgrimes/AnyEvent-Filesys-Notify/issues>

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

This software is copyright (c) 2017 by Mark Grimes, <mgrimes@cpan.org>.

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

2022-04-08 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.