[Win32utils-devel] Need some help with pure Rubywin32-changenotify

Park Heesob phasis at gmail.com
Mon Aug 6 12:10:23 EDT 2007

----- Original Message ----- 
From: "Daniel Berger" <djberg96 at gmail.com>
To: "Development and ideas for win32utils projects" <win32utils-devel at rubyforge.org>
Sent: Monday, August 06, 2007 1:46 PM
Subject: Re: [Win32utils-devel] Need some help with pure Rubywin32-changenotify

> On 8/5/07, Heesob Park <phasis at gmail.com> wrote:
>> Hi,
>> 2007/8/6, Daniel Berger <djberg96 at gmail.com>:
>> > Ok, solved the remaining issues. I had to move the CloseHandle call in
>> > the wait method above the yield/return. Also, I had to increase the
>> > buffer size for the final string name.
>> >
>> > Now I'm wondering if I should automatically prepend the @path to the
>> > file name in the final struct. We could use File.expand_path for
>> > relative paths.
>> >
>> > What do you think?
>> I think prepending the @path to the file name is better than printing the
>> relative paths.
>> And appliyng File.expand_path gives wrong result when running on different
>> path from monitoring path.
> Ah, that's right, thanks. Ok, I've simply join'd the @path to the file
> name. That's now in CVS.
> Oh, one thing that I've noticed is that it sometimes returns the
> filename as "4913". I know I've seen this issue come up at some point
> before (with the C code, too), but I can't remember what the answer
> was, and my Google skills are failing me.
> Do you happen to remember what causes that?
Sorry, I don't remember that issue. and I never met such case.

But I noticed other two issues.
First, sometimes filename has trailing garbage characters.
It can be fixed by modifing changenotify.rb line # 171 to
  file = fni[12,len] + "\0\0"   # add null char

Second, sometimes some events missed when two or more files were removed or added at the same time.
I'm not sure it is a known issue.

Park Heesob

More information about the win32utils-devel mailing list