From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 11 22:47:05 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD7B384D for ; Wed, 11 Mar 2015 22:47:05 +0000 (UTC) Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net [150.101.137.145]) by mx1.freebsd.org (Postfix) with ESMTP id 50864A53 for ; Wed, 11 Mar 2015 22:47:04 +0000 (UTC) Received: from ppp118-210-187-121.lns20.adl6.internode.on.net (HELO midget.dons.net.au) ([118.210.187.121]) by ipmail06.adl6.internode.on.net with ESMTP; 12 Mar 2015 09:16:42 +1030 Received: from [10.0.2.26] ([10.0.2.26]) (authenticated bits=0) by midget.dons.net.au (8.15.1/8.14.9) with ESMTPSA id t2BMkZvP030045 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Mar 2015 09:16:40 +1030 (CST) (envelope-from darius@dons.net.au) Subject: Re: file system change notifications Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: text/plain; charset=us-ascii From: "O'Connor, Daniel" In-Reply-To: Date: Thu, 12 Mar 2015 09:16:34 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: <237A50A5-FAB7-4FC1-B8F1-0E40DCBF6137@dons.net.au> References: To: Kim Shrier X-Mailer: Apple Mail (2.2070.6) X-Spam-Score: -2.899 () ALL_TRUSTED,BAYES_00,URIBL_BLOCKED X-Scanned-By: MIMEDefang 2.75 on 10.0.2.1 Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 22:47:05 -0000 > On 12 Mar 2015, at 05:31, Kim Shrier wrote: > I have a project where I need to notice changes to files in a large = directory tree. > I noticed that there was a project in GSOC 2010 to implement such a = feature. >=20 > https://wiki.freebsd.org/SOC2010IlyaPutsikau=20 >=20 > It appears that it was never completed. Is it desirable to have this = project > completed and added into FreeBSD. Or, is there another way to get = file > system change notifications? The 'standard' way is kqueue + masses of file descriptors. I am looking at using auditpipe(4) since you can register to be notified = for all file modifications and you get a path. I wrote some test code at = https://gist.github.com/DanielO/e36de242e79fed3fe4f7 Ideally we could add an inotify() syscall although I think that is still = suboptimal since you need to add a watch per directory so it can be = relatively expensive to setup. That said working out what to do in the = face of links and so on is tricky.. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C