From owner-freebsd-fs@FreeBSD.ORG Sat Jun 2 22:46:32 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7597516A400 for ; Sat, 2 Jun 2007 22:46:32 +0000 (UTC) (envelope-from cristi@net.utcluj.ro) Received: from bavaria.utcluj.ro (bavaria.utcluj.ro [193.226.5.35]) by mx1.freebsd.org (Postfix) with ESMTP id 2E07F13C44C for ; Sat, 2 Jun 2007 22:46:32 +0000 (UTC) (envelope-from cristi@net.utcluj.ro) Received: from localhost (localhost [127.0.0.1]) by bavaria.utcluj.ro (Postfix) with ESMTP id A183C5095D; Sun, 3 Jun 2007 01:46:30 +0300 (EEST) X-Virus-Scanned: by the daemon playing with your mail on bavaria.utcluj.ro Received: from bavaria.utcluj.ro ([127.0.0.1]) by localhost (bavaria.utcluj.ro [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8haKH0aOZEbp; Sun, 3 Jun 2007 01:46:25 +0300 (EEST) Received: from [86.125.188.48] (cl-86-125-188-48.cablelink.mures.rdsnet.ro [86.125.188.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bavaria.utcluj.ro (Postfix) with ESMTP id D94C7509BB; Sun, 3 Jun 2007 01:46:24 +0300 (EEST) Message-ID: <4661F340.6080009@net.utcluj.ro> Date: Sun, 03 Jun 2007 01:46:24 +0300 From: Cristian KLEIN Organization: Data Communication Center - Technical University of Cluj-Napoca User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: Flavio Castelli References: <200706011557.13769.micron@bglug.it> In-Reply-To: <200706011557.13769.micron@bglug.it> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: file system notifications X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2007 22:46:32 -0000 Flavio Castelli wrote: > Hello to all, I develop an open-source desktop searching program called > Strigi. Since actually the program supports file system notifications only > under Linux (using inotify), I would like to add this feature also to freeBSD > users. I am curious. Have you tried fam? As far as I know, fam was created so that developers won't have to bother about the mechanism they should use to get file notifications. > I looked at kqueue and I played with it a bit, but unfortunately I discovered > it isn't enough for me. > > That's what I have to do: watch a set of directories and get notifications for > some kind of event that happens into these directories. > The main problems with kqueue are: > - I have to open tons of file descriptors > - struct kevent doesn't tell event's main character (the file/dir that has > been created/modified/deleted/...) > > Searching around I discovered that darwin has fsevents (a device used also by > Spotlight), but it isn't available under freeBSD (am I right?). You can see > its sources here [1] and here [2]. > > So, what can I use for monitoring file system events under freeBSD? > > Thanks in adance > Flavio > > > [1] http://fxr.watson.org/fxr/source/bsd/sys/fsevents.h?v=DARWIN8 > [2] http://fxr.watson.org/fxr/source/bsd/vfs/vfs_fsevents.c?v=DARWIN8 -- +-------------------------------------+ | Cristian KLEIN | | Network Engineer | | Communication Center | | Technical University of Cluj-Napoca | +-------------------------------------+ | Tel: +40-264-401247, int. 247 | | WWW: http://www.cc.utcluj.ro | +-------------------------------------+