From: Dave Lilley Date: 2010-09-29T16:20:24+09:00 Subject: Re: new file arrivals into a specific directory / folder John W Higgins wrote: > Morning Dave, > > On Mon, Sep 27, 2010 at 3:43 AM, Dave Lilley wrote: > >> greetings one and all, >> >> My need is this. >> Get my program to be executed when ever something new arrives into a >> directory. >> > > Very straight forward here. Using the rb-notify library ( > http://github.com/nex3/rb-inotify) > > i = INotify::Notifier.new > > i.watch('/directory', :close_write) do |ev| > puts "#{ev.name.to_s} just added" > end > > i.run > > You could shell out or embed this in your app or whatever else you > wanted > but this will fire the block for every new file placed in the directory. > > John many thanks for the heads up think this was what I had read or was it in a repository and called lib-inotify ruby?? what ever this was what I was looking for. by the way would cron be a good 2nd? i.e every X seconds / minutes / hours it spawns/executes my script to to check for new files / emails and then proceed to process them? dave. cheers, -- Posted via http://www.ruby-forum.com/.