| Mdc::ChangeNotify |
Mdc::ChangeNotify v1.00 6/14/2007
use Mdc::ChangeNotify; my $OBJ = new Mdc::ChangeNotify($path); print "Waiting for a change:..."; while( !$OBJ->changed ){ sleep 1; } print "Something changed.\n";
Allows you to test for a file change in a given directory without causing your script to wait. Indicates exactly which files have changed and what attribute has changed.
$OBJ->{attr_desc}
A hash reference containing the description of each file attribute.
1 = New file 2 = File removed 3 = File mod date change 4 = Size change 5 = New directory 6 = Directory removed 7 = Directory mod date change
my $OBJ = new Mdc::ChangeNotify( $path [, $file, ...] );
Returns a reference to the created object. Scans the directory indicated by $path. If a list of files is supplied, will only scan for those files. There is no need for a close method. Simply undef the object or exit your script. Will not recurse into a sub directories.
The file list will be held in memory until the object is undefined. You may limit the number of files that will be scanned by setting the 'limit' attribute to the desired maximum. The default is zero which is no limit.
my $OBJ->changed();
Will return a hash of filenames that have changed since this object was created or since the last time this method was called in the form (filename, attribute, ...) The attribute indicates one of the following:
1 = New file
2 = File removed
3 = Modification date change
4 = Size change
5 = New directory
6 = Directory removed
7 = Modification date change
See the 'help' method below.
Mdc::ChangeNotify Copyright (c) 2007-2008 Mark K Mueller. All rights reserved. (www.markmueller.com)
| Mdc::ChangeNotify |