|new( $args )||Create a new File::Monitor::Object. Dont call new directly; use instead File::Monitor->watch.|
Perform a scan of the monitored file or directory and return a list
of changes. The returned list will contain either a single
File::Monitor::Delta object describing all changes or will be empty
if no changes occurred.
When scan is first called the current state of the monitored file/directory will be captured but no change will be reported.
|callback( [ $event, ] $coderef )||
Register a callback. If $event is omitted the callback will be called
for all changes. Specify $event to limit the callback to certain event
types. See File::Monitor::Delta for a full list of events.
See File::Monitor::Delta for a full list of events that can be monitored.
|name||Returns the absolute name of the file or directory being monitored. If new was passed a relative path it is resolved relative to the current directory at the time of object creation to make it absolute.|
|files||If monitoring a directory and the recurse or files options were specified to new, files returns a list of contained files. The returned filenames will be absolute paths.|
In addition to the above the following methods may be called to return the value of the corresponding field from stat in perlfunc:
dev inode mode num_links uid gid rdev size atime mtime ctime blk_size blocks
my $inode = $obj->inode;
%s is read-only You have attempted to modify a read-only accessor. It may be tempting for example to attempt to change the name of the monitored file or directory like this:
# Wont work $obj->name( somefile.txt );
When options are supplied as a hash there may be no other arguments When creating a new File::Monitor::Object you must either supply new with a reference to a hash of options or, as a special case, pass a filename and optionally a callback. The name option must be supplied The options hash must contain a key called name that specifies the name of the file or directory to be monitored. A filename must be specified You must suppy new with the name of the file or directory to be monitored.
File::Monitor::Object requires no configuration files or environment variables.
No bugs have been reported.
Andy Armstrong <email@example.com>
Faycal Chraibi originally registered the File::Monitor namespace and then kindly handed it to me.
Copyright (c) 2007, Andy Armstrong <firstname.lastname@example.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|perl v5.20.3||FILE::MONITOR::OBJECT (3)||2010-10-27|