Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Jul 2000 23:11:15 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.ORG>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        arch@FreeBSD.ORG, Sheldon Hearn <sheldonh@uunet.co.za>
Subject:   RE: truncate(1) implementation details
Message-ID:  <200007040611.XAA37685@john.baldwin.cx>
In-Reply-To: <200007032156.OAA37008@john.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org> -- 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007040611.XAA37685>