From owner-freebsd-arch Mon Jul 3 13:44:43 2000 Delivered-To: freebsd-arch@freebsd.org Received: from dt052n3e.san.rr.com (dt052n3e.san.rr.com [204.210.33.62]) by hub.freebsd.org (Postfix) with ESMTP id B325037C1B9 for ; Mon, 3 Jul 2000 13:44:39 -0700 (PDT) (envelope-from DougB@gorean.org) Received: from gorean.org (doug@master [10.0.0.2]) by dt052n3e.san.rr.com (8.9.3/8.9.3) with ESMTP id NAA89883; Mon, 3 Jul 2000 13:41:55 -0700 (PDT) (envelope-from DougB@gorean.org) Message-ID: <3960FA93.4AE5B9EE@gorean.org> Date: Mon, 03 Jul 2000 13:41:55 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (X11; U; FreeBSD 5.0-CURRENT-0702 i386) X-Accept-Language: en MIME-Version: 1.0 To: Sheldon Hearn Cc: Ben Smithurst , arch@FreeBSD.ORG Subject: Re: truncate(1) implementation details References: <32476.962635052@axl.ops.uunet.co.za> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sheldon Hearn wrote: > > On Mon, 03 Jul 2000 14:37:16 +0100, Ben Smithurst wrote: > > > I agree with alex that it should create files iff -c (or something) > > is given on the command line, and the default should be NOT to create > > anything. > > Cool. That seems to be agreed all around. Errr.. no. I agree that truncate(1) should be consistent with truncate(2). Rod also made the excellent point that -c means exactly the opposite in touch than you are proposing here. Even in a script, [ truncate foo ] || touch foo is not that hard to write. > So we've got: > > truncate [-cv] [+|-]size file [...] > -c Create files as necessary > -v Warn about attempts to truncate below zero bytes > > where + and - turn the size argument into a delta to be applied, rather > than an absolute size. Assuming that 'truncate 1024 foo' turns foo into a file with 1024 bytes in the absence of any +/- signs, I don't see anything wrong with the addition of the "delta" business. I'm also assuming that the -v option is only relevant in the presence of the - sign, yes? Doug -- "Live free or die" - State motto of my ancestral homeland, New Hampshire Do YOU Yahoo!? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message