I'm trying to write a program which will check a certain directory for incoming files. I want this program to be interrupt-driven such that as soon as a file is put into this directory, my program is signaled and can process the file.
I realize that my program can wake up at fixed intervals and check the directory itself for new files. But I'm hoping for a more elegant solution.
Is there any way for my program to have the UNIX operating system notify me of the creation of a file in my subdirectory ?