http://qs1969.pair.com?node_id=1061834

The_Dj has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks.

I need to watch for files appearing, dissapearing or changing.
My environment is Windows (several server versions) and Strawberryperl 5.18.
I also need to be as resource-light as possible as many target servers run at close to or over loaded.

Naturally Win32::FileSystem::Watcher seems to be the best solution since it does evrything I need

But I have a strange problem:
While the watcher is watching a directory any attempt to rename a file is met with a popup 'cannot rename <file> it is being used...'.
However I can create, modify or delete with no problems.

I'm testing with a very simple program:
use Win32::FileSystem::Watcher; my $watcher = Win32::FileSystem::Watcher->new("c:\\test"); $watcher->start(); while (1) { my @entries = $watcher->get_results(); foreach my $entry (@entries) { print $entry->action_name . " " . $entry->file_name . "\n"; } sleep 2; }
Any help?