From nobody Wed Aug 05 20:38:41 2026 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hFj1J0mk8z6n84M for ; Wed, 05 Aug 2026 20:38:44 +0000 (UTC) (envelope-from markj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hFj1H6fc4z49nF; Wed, 05 Aug 2026 20:38:43 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785962323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PKofK764mqTndk7p/jeHdtHFkhrgJG1Yt02Df7V/aqo=; b=SQqS44YFkpMwfQjudXpUxfhhDNSkxARi3SM7cvpvXcaKPNxROpsYaCEXdCrhiJEr/ucvYZ bLptWF4AIunJCa+RwHjp5JceUD6EvVkMLoYeBfCIigMeLc/SilTsPmDELK2NkEDlZIauK9 RZZFM+et6IBApb303DxfKkAy73z8ZzDiDcRZmAOphPtxoI3c6g+KKBcBPWThgaJvr714az rxoe4wk8v1wHQy4UzBWo0kixP3DUTLwWqLH5e7jIpC/8ub4dFDPJicmCIxKe/h2A3bFvqU tkRkxYtxRUdGDJmO1AJCL4velymAkn4+OGgdSfZRz+SbUeYDudiqVuvBOYBSeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785962323; a=rsa-sha256; cv=none; b=g++M4CB0GKQLSk+Bkiqiw/VzCYdUNaNEY7y1/TbBZC6jnVfJfOtaX61eeARuZAVuDB9Ncz 1M8OU5MqpbQpJ5BLEaANWauLIaYMj5R03ROZ92Gx0X/e0lkH0RlicJVbjXwMEw47+Kaopi g9RO41nJ15iy2OqdSbjK2gvYXI7sGx/US+1HLdX1RMUn9j/WMOM52grXiePOjJpRixXntI IftqwDREpmgAaj6qTnTY2nrWQdD6JNuwEnbGuGAOIIJMDZeL5uG1ouMQ4hBhZtUEGgnuZS 4akA3ZHyCU1ECNuqJNIVGUSyI4S00IQUrGAitkCkkJFGmL1ZlYkidpwEZB6MKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785962323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PKofK764mqTndk7p/jeHdtHFkhrgJG1Yt02Df7V/aqo=; b=BuD6jqhULn6SB1GMXqogLxdgL8PJSOqr4DOW2Fm3nyL5Rel124TjJm+y/vg1U0pIXVeiQl fbPpoVSvZDlEXKiEyNq17//SY4DWKqK/DsIwiHYoxJuuYjjoFK72PfJyFjiVOnANA/x24x XheVZEMGKlHwR+49iQ0nF5kV5n7TT9DomAZgYEmSQWepBZuJpAF0DJ87Eva5VB1soe6DR5 ho4z576S/rthFXsgYavo6AcC9xUMDEpHxlxNB5sdFPW3XEetrgcWNmCRRnhhd+LoeWWAeq 294yGQ8s6HRisfWAqTl5c3LRhaQ1DXlmSWZ2S+zoC0nX+GeNe/Am4lB2C//uDg== Received: from nuc (192-0-220-237.cpe.teksavvy.com [192.0.220.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4hFj1H3q0vzQ1P; Wed, 05 Aug 2026 20:38:43 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Wed, 5 Aug 2026 16:38:41 -0400 From: Mark Johnston To: "Bjoern A. Zeeb" Cc: hackers@freebsd.org Subject: Re: Native (small) inotifywait-like tool? Message-ID: References: <7qs8qr51-4n94-pspo-186-5sosn7562qso@mnoonqbm.arg> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7qs8qr51-4n94-pspo-186-5sosn7562qso@mnoonqbm.arg> On Wed, Aug 05, 2026 at 04:43:12PM +0000, Bjoern A. Zeeb wrote: > Hi, > > do we have a native tool (can be way simpler) like inotifywait? > > I am essentially looking for something which will trigger an action when a > file changes; the action could also be in a shell script so "wait" in a shell > script look would be acceptable. > > Problem is that I am very space contraint and don't want to pull in more > libraries etc. when a few kB would already do. > > I assume soemthing like the example in kqueue(2) will almost do? > > I am just wondering: we do not have a tool like this already in base? Not as far as I know. The inotify-tools package is pretty small though. There is also /usr/share/examples/inotify/inotify.c, which could be whipped into whatever shape you want pretty easily. kqueue is fine for monitoring a single file, not so much for monitoring a directory.