Watch Folder for New Files

I’ve got an application that needs to take action when new files appear
in a directory.

From a rails application, what would the easiest/best way to implement
this be?

When a new file appears, I’ll need to call an action on a controller
with the filename.

Any ideas much appreciated.

Regards,
JD

I’ve got an application that needs to take action when new files appear
in a directory.

From a rails application, what would the easiest/best way to implement
this be?

When a new file appears, I’ll need to call an action on a controller
with the filename.

Any ideas much appreciated.

How quickly does it need to be acted on? If one minute intervals are
okay, setup a cron job to run a script via script/runner to process any
files in that directory.

Otherwise look at using backgrounddrb to notify that a file has been
deposited and needs processing…

-philip