Tuesday, March 1, 2011

Monitor Directory for Changes

Much like a similar SO question, I am trying to monitor a directory on a Linux box for the addition of new files and would like to immediately process these new files when they arrive. Any ideas on the best way to implement this?

From stackoverflow
  • One solution I thought of is to create a "file listener" coupled with a cron job. I'm not crazy about this but I think it could work.

    Aaron Digulla : If you want to process them ASAP, there is no way around inotify.
  • Look at inotify.

    With inotify you can watch a directory for file creation.

0 comments:

Post a Comment