Полезная информация

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 19.2 Win32::ConsoleChapter 19
Win32 Modules and Extensions
Next: 19.4 Win32::Eventlog

19.3 Win32::ChangeNotification

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 ChangeNotification object for a specified directory and indicates how it should be monitored:

$ntfy = Win32::ChangeNotification->new(directory, subtree, filter);
The function returns a reference to the object as $ntfy. directory 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 filter parameter indicates what type of events will trigger a notification. It can be one of the following string values:

ATTRIBUTESAny attribute change
DIR_NAMEAny directory name change
FILE_NAMEAny filename change (creating/deleting/renaming)
LAST_WRITEAny change to a file's last write time
SECURITYAny security descriptor change
SIZEAny change in a file's size

The following methods are used on notification objects created by new:

Previous: 19.2 Win32::ConsolePerl in a NutshellNext: 19.4 Win32::Eventlog
19.2 Win32::ConsoleBook Index19.4 Win32::Eventlog