From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 16 14:29:03 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 951C716A4CE for ; Fri, 16 Jul 2004 14:29:03 +0000 (GMT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id D304F43D1D for ; Fri, 16 Jul 2004 14:29:01 +0000 (GMT) (envelope-from roam@ringlet.net) Received: (qmail 9970 invoked from network); 16 Jul 2004 14:24:41 -0000 Received: from unknown (HELO straylight.m.ringlet.net) (217.75.134.254) by gandalf.online.bg with SMTP; 16 Jul 2004 14:24:41 -0000 Received: (qmail 10388 invoked by uid 1000); 16 Jul 2004 14:28:58 -0000 Date: Fri, 16 Jul 2004 17:28:57 +0300 From: Peter Pentchev To: Denis Antrushin Message-ID: <20040716142856.GA1589@straylight.m.ringlet.net> Mail-Followup-To: Denis Antrushin , Alfred Perlstein , hackers@freebsd.org References: <20040716071545.GW95729@elvis.mu.org> <20040716072341.GX95729@elvis.mu.org> <40F78A8F.2010502@mail.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <40F78A8F.2010502@mail.ru> User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org cc: Alfred Perlstein Subject: Re: RFC: "-exit" option for find(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jul 2004 14:29:03 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 16, 2004 at 11:58:07AM +0400, Denis Antrushin wrote: > Alfred Perlstein wrote: > >I'm up too late, this doesn't work because find returns > >success whenever it successfully runs thought everything. > > > >Perhaps the primary change to just "-exit" which would > >make find exit successfully, and if the primary is never > >encountered (ie. our find logic never hits it) find would > >exit with a non-zero exit status? > > > >Ideas? Better ideas? > > > >The reason I want this is to avoid extracting a tarball > >over a directory that has files in it that are newer than > >the tarball. > > > >Neither tar nor find seem to make this easy... > What about this: >=20 > test -n "`find . -type f -newer ../src.tar.gz`" && echo hi I believe Alfred's problem with this is that it will still traverse the whole hierarchy even after a match is found. In some cases, the hierarchy may be huge, and if the match is within the first 100-200 files, well... :) I wonder if it wouldn't be a bit better to add to find(1) something like -maxmatches N, similar to Alfred's idea, but not limited to a single match? G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 No language can express every thought unambiguously, least of all this one. --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA9+Yo7Ri2jRYZRVMRApPmAKDDW+NAcRPE1UrP9t9sIGhYzdPWJACffgRd DD6PKCCpnc0RsulKcFK269o= =fTOe -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e--