APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Fam

File Alteration Monitor. The program fam is a server that processes communicate with. Your app needs to link with libfam, register the files or directories you want to monitor, and check back for updates or just sleep waiting to be awoken by a change. Oh, and fam has to be running, and it has to use the portmap service.

On my RedHat ES system, the man page for the fam server was installed, as was a sample /etc/conf and the libfam library, but there was no fam(3X) manpage installed. Fortunately that's fairly easy to find on the internet.

There are a number of similar tools for this kind of monitoring. Most, like fam, have the advantage that the kernel is doing the real work here and everything else can just take a nap waiting for something to happen to the items of interest. That's obviously more efficient ("betterer") than brute force polling.

There are possible security concerns, which are covered in the fam man page, but as it says:

       Note that fam never opens the files its monitoring, and
       cannot be used by  a rogue client to read the contents of
       any file on the system.  fam only gives out the names of
       monitored files, and  only  monitors  files which  the
       client  can stat(1M).  Users can stat a file without having
       read permission on it as long as they have  search  permission
       on  the directory containing it.
 


Got something to add? Send me email.



2 comments



Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence







Mon Mar 14 09:16:06 2005: 172   anonymous


Most modern systems will have famd installed and running. It's used by gnome-vfs and nautilus file manager in the Gnome desktop enviroment to monitor file changes.

For instance if you open up your terminal and cd into ~/Desktop and make a new text file then the file will automagicly show up on your desktop if your using Gnome. Not sure about KDE, but I suppose they do something similar.

--Drag



Mon Mar 14 10:10:36 2005: 175   TonyLawrence

gravatar
Ahh.. that would probably be why it was only partially there on my system - I don't use any X..




------------------------
Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





Anyone who puts a small gloss on a fundamental technology, calls it proprietary, and then tries to keep others from building on it, is a thief. (Tim O'Reilly)

The worst crime against working people is a company which fails to operate at a profit. (Samuel Gompers)







This post tagged: