Difference between revisions of "Inotify, FAM, Gamin"

From Noah.org
Jump to navigationJump to search
Line 10: Line 10:
  
 
Python developers will want to look at [http://pyinotify.sourceforge.net/ pyinotify] and [http://www.gnome.org/~veillard/gamin/python.html Gamin Python]. These are Ubuntu packages python-pyinotify (universe) and python-gamin (main). There is also a handy collection of [http://inotify-tools.sourceforge.net/ inotify-tools] available that lets you easily use inotify from a CLI, applications, and in shell scripts.
 
Python developers will want to look at [http://pyinotify.sourceforge.net/ pyinotify] and [http://www.gnome.org/~veillard/gamin/python.html Gamin Python]. These are Ubuntu packages python-pyinotify (universe) and python-gamin (main). There is also a handy collection of [http://inotify-tools.sourceforge.net/ inotify-tools] available that lets you easily use inotify from a CLI, applications, and in shell scripts.
 +
 +
The [http://projects.l3ib.org/trac/fsniper fsniper] is an interesting tool for watching a directory and processing various event scripts based on the filetype of a new file.

Revision as of 15:14, 10 December 2008

This briefly explains the relationships of the various filesystem event monitoring subsystems. These use event-based systems to monitor the filesystem for changes. For example, this allows a GUI to automatically update a directory listing if files are added by a background process. The alternative is that the user would have to refresh or the application would have to poll the system for changes every few seconds.

  • FAM stands for File Alteration Monitor. It is one of the oldest portable event monitors. It sends events to an application when changes are made to files or directories that an application has registered to me monitored. FAM is complicated and old -- it was last updated 5 years ago. Bad choice.
  • Gamin is newer and simpler than FAM. It tries to be compatible with FAM while not implementing many of the obscure feature. It is moderately maintained and widely available on many distros. It is portable, but the focus of development and testing is on Linux. It has BSD support and can be found in FreeBSD Ports. Decent choice
  • dnotify is ancient and crusty and should be ignored. Bad choice.
  • inotify is a replacement for dnotify. It is kernel module for the Linux kernel. It is fast and lightweight and should be available on every Linux distro. The big downside is that it is a Linux-only thing -- no BSD or OSX portability. Good choice.

I wish Gamin were a little more polished and up to date. It would be my first choice since it is, in theory, more portable.

Python developers will want to look at pyinotify and Gamin Python. These are Ubuntu packages python-pyinotify (universe) and python-gamin (main). There is also a handy collection of inotify-tools available that lets you easily use inotify from a CLI, applications, and in shell scripts.

The fsniper is an interesting tool for watching a directory and processing various event scripts based on the filetype of a new file.