I want to write a program to do something whenever a certain type of file appears in a certain directory. What's the best way to do this?
Do you have to poll the directory to detect the change? Or is there some way of hooking into the OS so you get an 'event' when appropriate?
We're talking linux here.