From owner-freebsd-questions@FreeBSD.ORG Sun Nov 23 01:48:52 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3376916A4CE for ; Sun, 23 Nov 2003 01:48:52 -0800 (PST) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EE4A43FBD for ; Sun, 23 Nov 2003 01:48:50 -0800 (PST) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (localhost [127.0.0.1]) by fw.farid-hajji.net (8.12.10/8.12.10) with ESMTP id hAN9m6pd097582; Sun, 23 Nov 2003 10:48:12 +0100 (CET) (envelope-from cpghost@cordula.ws) Date: Sun, 23 Nov 2003 10:48:07 +0100 (CET) Message-Id: <200311230948.hAN9m6pd097582@fw.farid-hajji.net> From: "Cordula's Web" To: wegster@mindcore.net In-reply-to: <3FBFEE6B.4000803@mindcore.net> (message from Scott W on Sat, 22 Nov 2003 18:16:59 -0500) X-Mailer: Emacs-21.3.1/FreeBSD-4.9-STABLE References: <200311222258.hAMMwApd092388@fw.farid-hajji.net> <3FBFEE6B.4000803@mindcore.net> cc: freebsd-questions@freebsd.org Subject: Re: Monitoring a file? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: cpghost@cordula.ws List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2003 09:48:52 -0000 > > What is the canonical way to monitor accesses to a file? > You may want to take a look at 'fam,' in /usr/ports/devel/fam , as some > of the code's already been done for this type of monitoring AFAIK... Yes, that is a nice framework to start with. It uses help from the kernel (imon pseudo device on irix or linux), or polls the files with lstat(). It could be extended to use kevent(2) on FBSD... Unfortunately, it still doesn't know which process accessed the files. Hmmm... Thank you. -- Cordula's Web. http://www.cordula.ws/