[Win32utils-devel] RE: Bug fix

Berger, Daniel Daniel.Berger at qwest.com
Fri Feb 4 17:53:17 EST 2005

> -----Original Message-----
> From: CT [mailto:demerzel at gmail.com] 
> Sent: Friday, February 04, 2005 3:42 PM
> To: Berger, Daniel
> Subject: Re: Bug fix

> Okay, I tried 0.3.1, and the wait call blocks till a change 
> occurs. So it's working:)
> But I would still need a loop to get a daemon-like behaviour, 
> since the wait terminates when a change signals the monitor.
> Thanks
> CT

Hi CT,

(I'm cc'ing this to the win32-devel list, because I have an idea)

Whoops, yeah, you're right.  Sorry about that - I misunderstood.

Hm...what do you think about modifying ChangeModify#wait (or possibly
Ipc#wait) to accept an optional 2nd "recursive" argument, that would
indicate whether a wait call with an associated block would break out or
repeat indefinitely?

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

Or am I getting too tricky?



More information about the win32utils-devel mailing list