Skip Menu |

This queue is for tickets about the Win32-IPC CPAN distribution.

Report information
The Basics
Id: 77261
Status: rejected
Priority: 0/
Queue: Win32-IPC

People
Owner: Nobody in particular
Requestors: David.Zhang [...] bowker.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.09
Fixed in: (no value)



Subject: Win32-IPC-1.09 > Win32::ChangeNotify
Date: Thu, 17 May 2012 15:17:58 -0400
To: "bug-Win32-IPC [...] rt.cpan.org" <bug-Win32-IPC [...] rt.cpan.org>
From: "Zhang, David" <David.Zhang [...] bowker.com>
Hello, Win32::ChangeNotify may have some minor problems with the second argument $subtree. No matter what input 0 or 1 for subtree, it always checks the change in sub folders My perl is v5.10.1 built for MSWin32-x86-multi-thread My program is running on Window XP This module is very nice. I like it very much. Thank you very much for binging it to perl community. David Zhang David.zhang@Bowker.com
Subject: Win32::ChangeNotify always watches subtree
This turns out to be a problem with the underlying FindFirstChangeNotification API. There's nothing I can do about it. Here's the program I used to test it: use 5.010; use strict; use warnings; use Win32::ChangeNotify; my $notify = Win32::ChangeNotify->new(".", 0, # no subtree 'FILE_NAME DIR_NAME LAST_WRITE'); say 'waiting...'; while ($notify->wait) { say "change!"; $notify->reset; } I ran that script, and then in another console created & removed files in the watched directory and subdirectories of it. I sometimes got a notification when changing files in a subdirectory (although not all the time). I verified that it's a Windows bug by running the equivalent C program, which gave similar results: #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> int main(int argc, char* argv[]) { HANDLE cn = FindFirstChangeNotification(".", FALSE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE ); puts("waiting"); while (WaitForSingleObject(cn, INFINITE) == WAIT_OBJECT_0) { puts("change!"); FindNextChangeNotification(cn); } return 0; } /* end main */
Subject: RE: [rt.cpan.org #77261] Win32::ChangeNotify always watches subtree
Date: Thu, 17 May 2012 16:33:30 -0400
To: "bug-Win32-IPC [...] rt.cpan.org" <bug-Win32-IPC [...] rt.cpan.org>
From: "Zhang, David" <David.Zhang [...] bowker.com>
Thank you so much for your quick response. I like your modules. Actually the subtree issue doesn't bother me too much. All I need to do is to add more codes to find out where the changes are from. Thanks again. David Zhang Show quoted text
-----Original Message----- From: Christopher J. Madsen via RT [mailto:bug-Win32-IPC@rt.cpan.org] Sent: Thursday, May 17, 2012 4:29 PM To: Zhang, David Subject: [rt.cpan.org #77261] Win32::ChangeNotify always watches subtree <URL: https://rt.cpan.org/Ticket/Display.html?id=77261 > This turns out to be a problem with the underlying FindFirstChangeNotification API. There's nothing I can do about it. Here's the program I used to test it: use 5.010; use strict; use warnings; use Win32::ChangeNotify; my $notify = Win32::ChangeNotify->new(".", 0, # no subtree 'FILE_NAME DIR_NAME LAST_WRITE'); say 'waiting...'; while ($notify->wait) { say "change!"; $notify->reset; } I ran that script, and then in another console created & removed files in the watched directory and subdirectories of it. I sometimes got a notification when changing files in a subdirectory (although not all the time). I verified that it's a Windows bug by running the equivalent C program, which gave similar results: #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> int main(int argc, char* argv[]) { HANDLE cn = FindFirstChangeNotification(".", FALSE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE ); puts("waiting"); while (WaitForSingleObject(cn, INFINITE) == WAIT_OBJECT_0) { puts("change!"); FindNextChangeNotification(cn); } return 0; } /* end main */
Subject: RE: [rt.cpan.org #77261] Win32::ChangeNotify always watches subtree
Date: Mon, 21 May 2012 10:30:54 -0400
To: "bug-Win32-IPC [...] rt.cpan.org" <bug-Win32-IPC [...] rt.cpan.org>
From: "Zhang, David" <David.Zhang [...] bowker.com>
Hello Chris, Can Win32::ChangeNotify return more messages such as which files or folders are modified? Are there any other modules for this purpose? Many thanks David Zhang Show quoted text
-----Original Message----- From: Christopher J. Madsen via RT [mailto:bug-Win32-IPC@rt.cpan.org] Sent: Thursday, May 17, 2012 4:29 PM To: Zhang, David Subject: [rt.cpan.org #77261] Win32::ChangeNotify always watches subtree <URL: https://rt.cpan.org/Ticket/Display.html?id=77261 > This turns out to be a problem with the underlying FindFirstChangeNotification API. There's nothing I can do about it. Here's the program I used to test it: use 5.010; use strict; use warnings; use Win32::ChangeNotify; my $notify = Win32::ChangeNotify->new(".", 0, # no subtree 'FILE_NAME DIR_NAME LAST_WRITE'); say 'waiting...'; while ($notify->wait) { say "change!"; $notify->reset; } I ran that script, and then in another console created & removed files in the watched directory and subdirectories of it. I sometimes got a notification when changing files in a subdirectory (although not all the time). I verified that it's a Windows bug by running the equivalent C program, which gave similar results: #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> int main(int argc, char* argv[]) { HANDLE cn = FindFirstChangeNotification(".", FALSE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE ); puts("waiting"); while (WaitForSingleObject(cn, INFINITE) == WAIT_OBJECT_0) { puts("change!"); FindNextChangeNotification(cn); } return 0; } /* end main */
Please don't use bug reports as a generic help topic. Questions like that are best asked on http://stackoverflow.com/ Tag it with 'perl' and I'll most likely see it, and other people can answer it as well. No, the FindFirstChangeNotification API doesn't tell you what changed, only that something (probably) did.