Win32::ChangeNotify
This module provides access to Win32 change-notification
objects, letting you monitor events relating to files and directory
trees. The constructor for this class is new, which creates a ChangeNotify object for
a specified path and indicates how it should be monitored:
$ntfy = Win32::ChangeNotify->new(path,subtree,events); $ntfy->wait or warn "Something has failed: $!");
The function returns a reference to the object as $ntfy. path is
the pathname of the directory to monitor.
subtree is a Boolean value that, if true,
forces the object to monitor all subdirectories of the object’s path.
The eventsparameter indicates the type of
events that will trigger a notification. It can be one of the
following string values:
Value | Description |
|---|---|
ATTRIBUTES | Any attribute change |
DIR_NAME | Any directory name change |
FILE_NAME | Any filename 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 |
The following methods are used on notification objects created
by new.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access