From owner-freebsd-fs@freebsd.org Thu Dec 31 07:24:08 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26816A563B7 for ; Thu, 31 Dec 2015 07:24:08 +0000 (UTC) (envelope-from chris@stankevitz.com) Received: from mango.stankevitz.com (mango.stankevitz.com [208.79.93.194]) by mx1.freebsd.org (Postfix) with ESMTP id 19D221EBC for ; Thu, 31 Dec 2015 07:24:07 +0000 (UTC) (envelope-from chris@stankevitz.com) Received: from Chriss-MacBook-Pro.local (209-203-101-124.static.twtelecom.net [209.203.101.124]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mango.stankevitz.com (Postfix) with ESMTPSA id 2BC69B1 for ; Wed, 30 Dec 2015 23:24:01 -0800 (PST) From: Chris Stankevitz Subject: Monitoring FS changes To: FreeBSD Filesystems Message-ID: <5684D810.6070700@stankevitz.com> Date: Wed, 30 Dec 2015 23:24:00 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2015 07:24:08 -0000 Hi, I have a directory /foo that recursively contain ~250,000 files/directories. I would like my application to know when a file is added, removed, or modified under /foo. Is there a way to do that with FreeBSD? I believe on linux a facility called iNotify accomplishes this. On OSX a facility called FSEvents accomplishes this. kqueue apparently requires me to open every file and/or directory in my tree... which won't work because I have so many. Is there any other option? Perhaps i=0 while (true) { zfs snapshot pool/foo@${i} zfs diff pool/foo@${i-1} pool/foo@${i} ++i } Thank you, Chris