From owner-freebsd-arch Mon Jul 3 23:10:24 2000 Delivered-To: freebsd-arch@freebsd.org Received: from server.baldwin.cx (server.geekhouse.net [64.81.6.52]) by hub.freebsd.org (Postfix) with ESMTP id CD2DB37BB08; Mon, 3 Jul 2000 23:10:21 -0700 (PDT) (envelope-from john@baldwin.cx) Received: from john.baldwin.cx (root@john.baldwin.cx [192.168.1.18]) by server.baldwin.cx (8.9.3/8.9.3) with ESMTP id XAA31833; Mon, 3 Jul 2000 23:10:12 -0700 (PDT) (envelope-from john@baldwin.cx) Received: (from john@localhost) by john.baldwin.cx (8.9.3/8.9.3) id XAA37685; Mon, 3 Jul 2000 23:11:16 -0700 (PDT) (envelope-from john) Message-Id: <200007040611.XAA37685@john.baldwin.cx> X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200007032156.OAA37008@john.baldwin.cx> Date: Mon, 03 Jul 2000 23:11:15 -0700 (PDT) From: John Baldwin To: John Baldwin Subject: RE: truncate(1) implementation details Cc: arch@FreeBSD.ORG, Sheldon Hearn Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 03-Jul-00 John Baldwin wrote: > > On 03-Jul-00 Sheldon Hearn wrote: >> >> Hi folks, >> >> I'm looking through Alexander Langer's truncate(1) with a view to >> importing it shortly. >> >> I raised some issues with Alexander and he responded with the message >> below. The issue I'd like feedback on is whether or not truncate(1) >> should create files given on the command-line when those files do not >> exist at the time of invocation. >> >> My feeling is that truncate should not do so. Alexander's opinion is >> given in the e-mail message. >> >> Any compelling arguments in either direction? > > I think it should create the file. touch(1)'s job is just to change > the file access and mod times, yet it creates files. Thus, I think > there is adequate precedent for truncate(1) creating files. After thinking about this further, since people keep pointing to touch(1)'s -c as a POLA violation wrt to the proposed -c to truncate(1), I think this points out that many people will view touch(1) and truncate(1) similary. Thus, if we really want to be consistent, they should have the same semantics. That is, both utilities will create files by default if they don't exist, and both will abstain from creating non-existent files if '-c' is provided. To me, that is the most consistent way to do it, especially since people are already grouping touch(1) and truncate(1) together. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message