From: CT Date: 2005-02-05T06:49:09+09:00 Subject: Re: [ANN] win32-changenotify 0.3.0 > > require "win32/changenotify" > > include Win32 > > > > # Wait for any writes to files in the C:\ drive. > > filter = ChangeNotify::LAST_WRITE > > cn = ChangeNotify.new("C:\\",true,filter) > > cn.wait{ |s| > > puts "Something changed" > > puts "File: " + s.file_name > > puts "Action: " + s.action > > } > > Okay, I got this working, kinda, after mucking around a bit. What I want is a daemon-like thingie which will give me notifications when stuff inside a partocular directory changes. Is it advisable to wrap the cn.wait call inside an infinite loop, for this? Are there any consequences for that? I did something like this: while true cn.wait{ |s| puts "Something changed" puts "File: " + s.file_name puts "Action: " + s.action } end This does detect file changes, but I donot understand how I get away without calling cn.reset. Is that invoked when the block is called? Thanks! CT