From: "Ara.T.Howard" Date: 2004-06-08T21:23:39+09:00 Subject: Re: Waiting for condor output files On Tue, 8 Jun 2004, Milo Thurston wrote: > Martin DeMello wrote: >> You might be better off with a thread per loop, then, which fills an >> entry into a global array or hash when its particular job finishes. That >> way, if you want you can start processing files as they come in, and not >> block on waiting for the next in sequence to get done. > > That's not something I've encountered yet. > Are there any on-line examples I could take a look at, to see > how it works? > Thanks. > > -- > www.sirwilliamhope.org this already does it http://freepan.org/ruby/by-dist/fs-watcher/ check out the testsuite for examples you would probably use it like: watcher = FileSystemWatcher.new("condor_outdir", "*") watcher.sleepTime = 1 watcher.start { |status,file| if status == FileSystemWatcher::CREATED then puts "#{ file } was created" elsif status == FileSystemWatcher::MODIFIED then puts "#{ file } was modified" elsif status == FileSystemWatcher::DELETED then puts "#{ file } was deleted" end } cheers. -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; and a weed grows, even though we do | not love it. --Dogen ===============================================================================