From: Siep Korteling Date: 2008-09-23T07:36:32+09:00 Subject: Re: ruby gem to watch file Junkone wrote: > On Sep 20, 11:15�pm, Tim Pease wrote: >> >> Blessings, >> TwP > > i tried as you suggested and have a few q. > i am trying to run a ruby prog to execute if there is any new file in > a directory. i started out with the examples but am a little confused > on how to useit. > this prog seems to be looking at the current directory where it is > running and not where i had specificed it to watch with dw.glob. > > appreciate any help. > > seede > (...) Hm, I can't get it to work either (on WinXP). require 'directory_watcher' dw = DirectoryWatcher.new 'D:/temp/' dw.interval=5 dw.add_observer {|*args| args.each {|event| puts event}} dw.start gets dw.stop It does display the files ("added 'D:/temp/Pink_Pajamas.amv'" etc), but after that you can delete, add and edit files without directory_watcher noticing anything. Is it broken on windows or am I doing something wrong? Regards, Siep -- Posted via http://www.ruby-forum.com/.