Win32::ChangeNotify - Monitor events related to files and directories
require Win32::ChangeNotify; $notify = Win32::ChangeNotify->new($Path,$WatchSubTree,$Events); $notify->wait or warn "Something failed: $!\n"; # There has been a change.
This module allows the user to use a Win32 change notification event object from Perl. This allows the Perl program to monitor events relating to files and directory trees.
wait method and
wait_any functions are inherited from the "Win32::IPC" module.
- $notify = Win32::ChangeNotify->new($path, $subtree, $filter)
Constructor for a new ChangeNotification object.
$pathis the directory to monitor. If
$subtreeis true, then all directories under
$pathwill be monitored.
$filterindicates what events should trigger a notification. It should be a string containing any of the following flags (separated by whitespace and/or
ATTRIBUTES Any attribute change DIR_NAME Any directory name change FILE_NAME Any file name change (creating/deleting/renaming) LAST_WRITE Any change to a file's last write time SECURITY Any security descriptor change SIZE Any change in a file's size
$filtercan also be an integer composed from the
Shut down monitoring. You could just
undef $notifyinstead (but
closeworks even if there are other copies of the object). This happens automatically when your program exits.
Resets the ChangeNotification object after a change has been detected. The object will become signalled again after the next change. (It is OK to call this immediately after
new, but it is not required.)
See "Win32::IPC". Remember to call
resetafterwards if you want to continue monitoring.
Win32::ChangeNotify still supports the ActiveWare syntax, but its use is deprecated.
$Obj = Win32::ChangeNotify->new($PathName,$WatchSubTree,$Filter)
Christopher J. Madsen <firstname.lastname@example.org>
Loosely based on the original module by ActiveWare Internet Corp., http://www.ActiveWare.com