Watching a directory for changes: SOLVED, sorta

Joel Hammer Joel
Mon May 17 11:44:50 PDT 2004


This is an old question I had. The main problem was the sleep command
only works in one second intervals. At the time, nobody could give me
an easy answer.

To my surprise (not really) there is a command which does just what I
want: usleep -m 200

This sleeps for 200 milliseconds.

I stumbled across this at the StepsbySteps.

I have this sneaky suspicion that there is a lot more to linux than
I know.

Joel


On Thu, Oct 24, 2002 at 09:56:35PM -0400, Joel Hammer wrote:
> I want to have a background job watching a directory for new files
> arriving, and then responding when they arrive.
> The response time has to be very quick (impatient humans), maybe on the order
> of a 1/2 second or less.
> I could have a bash script watching the directory, but the sleep command
> works in intervals of 1 second. Not fast enuf.
> Any ideas appreciated,
> Joel


More information about the Linux-users mailing list