Linux – How to programmatically react to folder changes

linux

I have an application that needs to process large files after they are uploaded to the system. In Linux, is it possible to detect folder changes and have a script run automatically, or should I just run a cron job every minute to look for new files?

Best Answer

Checkout inotify. If your running a recent kernel it will be included. There are numerous APIs for numerous languages out there for it.