in reply to Re: Re: Daemon To Check For Files
in thread Daemon To Check For Files

That's pretty nasty. I can't think of anything simple that will solve the essential problem, i.e. polling the directory, but you could probably help things out just by adding a sleep(1) to the end of your loop.

Replies are listed 'Best First'.
Re: Re: Re: Re: Daemon To Check For Files
by EvdB (Deacon) on Nov 05, 2003 at 09:05 UTC
    This reminded me of something I've been meaning to play with in the linux kernel:
    CONFIG_IMON:

    This enables support for imon, the inode monitor. Through imon and fam, the File Alteration Monitor, programs can express interest in individual files and directories, and the kernel will notify those programs when the files change. This enables desktops, mail readers, administration tools, etc. to respond to changes in the system immediately. If you don't enable imon, such programs will have to poll files (by checking them every few seconds) to determine whether they've changed.

    See http://oss.sgi.com/projects/fam/ for more information on imon.

    If you don't know whether you want imon, it doesn't do any harm to say N here. (If you want imon, say M, not Y.)

    This option lives under 'File Systems' and is called 'Inode Monitor Support'. If this file processing is important enough this may help you - assuming you are on linux...

    --tidiness is the memory loss of environmental mnemonics