bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14686: Bug#713022: truncate man and info pages must mention -s / -r


From: Pádraig Brady
Subject: bug#14686: Bug#713022: truncate man and info pages must mention -s / -r mandatory
Date: Sat, 22 Jun 2013 10:58:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 06/22/2013 09:42 AM, address@hidden wrote:
> I thought it would do the obvious, like touch does.
> 
> 
> NAME
>        touch - change file timestamps
> 
> SYNOPSIS
>        touch [OPTION]... FILE...
> 
> DESCRIPTION
>        Update  the  access  and modification times of each FILE to the current
>        time.
> 
>        A FILE argument that does not exist is created empty, unless -c  or  -h
>        is supplied.
> 
> 
> 
> NAME
>        truncate - shrink or extend the size of a file to the specified size
> 
> SYNOPSIS
>        truncate OPTION... FILE...
> 
> DESCRIPTION
>        Shrink or extend the size of each FILE to the specified size
> 
>        A FILE argument that does not exist is created.
> 
> 
> 
> Who would have guessed that for some reason an argument is required,
> I don't see why
> $ truncate FILE
> cannot just work too.
> You know, to truncate the file, to zero bytes.
> But hey I'm not a pro.

I remember discussing the interface at the time.
The thinking was that since data was destroyed here,
an explicit -s0 was required to avoid typos like:

  truncate - s1M file

Behaving like you suggest would create '-' and 's1M'
and truncate 'file' without warning.

cheers,
Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]