[Win32utils-devel] FW: Bug fix

Berger, Daniel Daniel.Berger at qwest.com
Fri Feb 4 18:27:19 EST 2005

Forwarded, because I don't think he's subscribed and I'm not getting an
email notification in my Yahoo account.


-----Original Message-----
From: CT [mailto:demerzel at gmail.com] 
Sent: Friday, February 04, 2005 4:17 PM
To: Berger, Daniel
Cc: win32utils-devel at rubyforge.org
Subject: Re: Bug fix

On Fri, 4 Feb 2005 16:53:17 -0600, Berger, Daniel
<Daniel.Berger at qwest.com> wrote:
> Hm...what do you think about modifying ChangeModify#wait (or possibly
> Ipc#wait) to accept an optional 2nd "recursive" argument, that

"recursive" would be confusing, don't you think? what with the same name
used in ChangeNotify.new as well.

> So, something like this:
> cn = ChangeNotify.new("C:\\",true,filter)
> # This would break out on the first change
> cn.wait{ |s|
>    p s
> }
> # This would recycle the block indefinitely, unless you broke out 
> manually somehow cn.wait(ChangeNotify::INFINITE,true){ |s|
>    p s
> }

Hmm. I don't know. I'm not sure if I wanna remember the
ChangeNotify::INFINITE constant - the default behaviour is intuitive, to
me(though the name's more ipc-ish than filesystem). Maybe a new method
in changenotify - something like the
start_monitoring(sic) in DirectoryWatcher. (I feel the API is too much
tied with ipc as it is. True, it inherits from ipc, but I'm not sure if
someone with the general watch-for-file-system-changes use-case wants to
know that there is ipc and monitors going on behind the scenes. Just my
2 paise, and hope I'm not treading on any toes)

At any rate, if there is nothing more special than a while(true) wrap
going on inside this special version of wait, I don't feel anything is
gained over -

cn.wait {|s|
p s
} while true

You can see that this is growing on me, even as I type:)

> Regards,
> Dan

Keep up the good work! I just looked up Change Journals in MSDN and I
can't wait for it to come out. I have *just* the thing to do with it,
for which plan to use changenotify for now.


More information about the win32utils-devel mailing list