How to avoid polling???

Hi all,

I have a directory where some process is keeping incremental/new log files. I need to code a program which will periodically poll this directory and if it founds a new file arrived then copy that new file to some other specific directory.
We are OK with this polling approach. I just wanted to know is there any way to get notification i.e. a kind of signal or interrupt which invokes my program after the new file arrives in first directory so that I can avoid this polling time and also save processor memory.

Thanks...

If you're on Linux check inotify.

Thanks radoulov .. this is good info..
But I am using SunSolaris ..

You could try searching the Net for FAM.
I've never used it so I cannot give additional info.

P.S. There is even FEM: