Thanks malcolmlewis, that looks like a useful utility. I must remember that.
But I fear it’s insufficient for the OP’s requirement. In particular it is used to monitor a file/pipe/etc that has input data written to it. When a file is added to a directory, that’s not writing data to a stream, it’s modifying a directory.
You could I suppose call ls or something periodically, doing a diff against the last run, and writing the diff to a file, but that defeats the purpose since it requires polling.
There is a Linux system call inotify that can be used to solve the OP’s requirement, it needs a utility written to call it to make it useful. A quick search turned up a Perl module that uses inotify. Perhaps a broader search will find a complete utility.
> You could I suppose call ls or something periodically, doing a diff
> against the last run, and writing the diff to a file, but that defeats
> the purpose since it requires polling.
famd.
famd (8) - The File Alteration Monitor (FAM) daemon
famd.conf (5) - The File Alteration Monitor (FAM) configuration file
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
Hi guys,
Am taking a look at these, too.
Curiously, it looks like a version of famd is already installed in a default 11.3 install, but inaccessible to the User, supposedly installed for the benefit of the KDE or Gnome desktops.
Found both fam-server (which installs a User-accessible version of famd) and gamin in the OpenSuSE repository.
ken_yap, am curious how you determined famd uses dnotify? Am looking, and can’t find a listed dependency, did you look that info up somewhere or run a trace?
Another option:
Just noticed that a “File Change Monitor” widget is included in a default KDE4 install. Probably hooks into the fam used by KDE but normally inaccessible to Users as I mentioned before.
Haven’t used it personally.