From owner-freebsd-questions@FreeBSD.ORG Fri Jul 23 20:44:48 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F21281065672 for ; Fri, 23 Jul 2010 20:44:48 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED4F8FC17 for ; Fri, 23 Jul 2010 20:44:48 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o6NKiiMx038273 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 23 Jul 2010 21:44:44 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) Message-ID: <4C49FF35.3090201@infracaninophile.co.uk> Date: Fri, 23 Jul 2010 21:44:37 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-GB; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: Neil Smith References: <178EAA50-D7FE-4355-91EC-3C1018465568@tamu.edu> In-Reply-To: <178EAA50-D7FE-4355-91EC-3C1018465568@tamu.edu> X-Enigmail-Version: 1.1.1 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDC07663C78D16F760B58D3CF" X-Virus-Scanned: clamav-milter 0.96.1 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_40,DKIM_ADSP_ALL, SPF_FAIL autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lucid-nonsense.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: monitor util in a scripted daemon? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 20:44:49 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDC07663C78D16F760B58D3CF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 23/07/2010 20:58:06, Neil Smith wrote: > - Is there a command (native, shell, or ports collection) to sit and wa= tch for new file creation in a directory? gamin -- http://people.gnome.org/~veillard/gamin/ > - I'd like to build a system startup script for such a command and its = scripted actions. Sound possible? It's in ports already. Doesn't appear to have a separate rc script -- it's part of gnome, and would get run along with those applications. > - Is there already something in the default OS that does something simi= lar? Look at kevent(2), kqueue(2) -- the EVFILT_VNODE filter can be used to pick up changes to the link count of a directory: ie that a file has been created or destroyed within it. Some C programming required. AFAIK there isn't a ready built application in the base OS to do what you want.= Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matthew@infracaninophile.co.uk Kent, CT11 9PW --------------enigDC07663C78D16F760B58D3CF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxJ/zwACgkQ8Mjk52CukIw0ZACbBRhx1jvQjBuxT5z1JjyVC0Nh cSwAn1lGRv6JHWlkI6y9mVqEkeIiB36T =5hdn -----END PGP SIGNATURE----- --------------enigDC07663C78D16F760B58D3CF--