Monitoring folder for changes


#1

Is there any gem or code example that would help me to watch a given
folder for changes and trigger a callback upon change detection?

Thanks!

– Felipe


#2

On Mar 27, 2009, at 5:39 PM, Felipe C. wrote:

Is there any gem or code example that would help me to watch a given
folder for changes and trigger a callback upon change detection?

Thanks!

– Felipe

Posted via http://www.ruby-forum.com/.

sudo gem install directory_watcher

a @ http://codeforpeople.com/


#3

Ara Howard wrote:

sudo gem install directory_watcher
a @ http://codeforpeople.com/

Now that was fast! Thanks Ara!

Best regards,

– Felipe


#4

Felipe C. removed_email_address@domain.invalid writes:

Ara Howard wrote:

sudo gem install directory_watcher
a @ http://codeforpeople.com/

Now that was fast! Thanks Ara!

If speed is more important than portability, you may want to consider
utilizing operating specific features. I believe Linux, OSX & Windows
all provide notifications of changes to the file system so you wouldn’t
have to periodically poll.