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.
More Articles by Tony Lawrence © 2011-03-20 Tony Lawrence
Dead trees and polluting ink. I'll be happy to see them go. (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
Ahh.. that would probably be why it was only partially there on my system - I don't use any X..
------------------------
Printer Friendly Version
fam: Tech Words of the Day Copyright © March 2005 Tony Lawrence
Have you tried Searching this site?
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
Printer Friendly Version