From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 12 13:37:53 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 4300DFDF for ; Thu, 12 Mar 2015 13:37:53 +0000 (UTC) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B94BA19 for ; Thu, 12 Mar 2015 13:37:53 +0000 (UTC) Received: by ieclw3 with SMTP id lw3so39966954iec.2 for ; Thu, 12 Mar 2015 06:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=APUeguMX0pRs79TFA/8atDN1ytPV28GkO3+htrGF7HI=; b=sD2xp1TNLei+RZ32Rm1uKaBSZSBtcRt0skjiAY+4DUFsrSSID1mWfPrvLHhyJBEpa2 NeQ9fTxI2UXh4XzoXGtdOhYTcfHzpPM2YFOFCr3xFrlls3N9VvAMIBBh/x02nrvngAdh QjW5yAPy0T4oRzzB2TvDyGVvY9ulX9thHQEdhzbQbaDhylhzZu8j64BnkX5s2Ic3kCSt DT7dCvbyi9K8RairQx1mmvMHmTZz575NbMh+JFY/FboTITWf+cNyUGeM06AM7nCa/L9O m99/QVONwbnFtamJ0HnhRTe7q1xaaGWsL5+pC2UAQBrNFUTNzFpgGyzF9vUJqucgkx3J OMCg== X-Received: by 10.107.148.197 with SMTP id w188mr74785705iod.73.1426167459707; Thu, 12 Mar 2015 06:37:39 -0700 (PDT) Received: from [172.22.132.60] ([192.119.231.58]) by mx.google.com with ESMTPSA id y6sm76560igw.21.2015.03.12.06.37.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Mar 2015 06:37:38 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: file system change notifications From: Guy Helmer In-Reply-To: <237A50A5-FAB7-4FC1-B8F1-0E40DCBF6137@dons.net.au> Date: Thu, 12 Mar 2015 08:37:34 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <5786089D-414D-485C-B675-35B5A62C5950@gmail.com> References: <237A50A5-FAB7-4FC1-B8F1-0E40DCBF6137@dons.net.au> To: "O'Connor, Daniel" X-Mailer: Apple Mail (2.2070.6) 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: Thu, 12 Mar 2015 13:37:53 -0000 On Mar 11, 2015, at 5:46 PM, O'Connor, Daniel = wrote: >=20 >=20 >> 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? >=20 > The 'standard' way is kqueue + masses of file descriptors. >=20 > I am looking at using auditpipe(4) since you can register to be = notified for all file modifications and you get a path. >=20 > I wrote some test code at = https://gist.github.com/DanielO/e36de242e79fed3fe4f7 >=20 > 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.. How are Darwin (OS X) fsevents implemented? It=E2=80=99s a been a handy = interface for some of my work. Guy