GNU bug report logs - #6268
Suggestion: truncate should allow -r and -s options together

Previous Next

Package: coreutils;

Reported by: "Richard W.M. Jones" <rjones <at> redhat.com>

Date: Tue, 25 May 2010 15:42:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pádraig Brady <P <at> draigBrady.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#6268: closed (Suggestion: truncate should allow -r and -s
 options together)
Date: Sat, 29 May 2010 09:48:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 29 May 2010 10:44:18 +0100
with message-id <4C00E1F2.5080202 <at> draigBrady.com>
and subject line Re: bug#6268: Suggestion: truncate should allow -r and -s options together
has caused the GNU bug report #6268,
regarding Suggestion: truncate should allow -r and -s options together
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
6268: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6268
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Richard W.M. Jones" <rjones <at> redhat.com>
To: bug-coreutils <at> gnu.org
Subject: Suggestion: truncate should allow -r and -s options together
Date: Tue, 25 May 2010 15:32:05 +0100
The manpage for truncate says:

  Note that the -r and -s options are mutually exclusive.

and indeed you cannot have both:

  $ truncate -r /tmp/ref -s +10M /tmp/new
  truncate: you must specify one of `--size' or `--reference'

We suggest using the 'truncate' command in the 'virt-resize'
documentation[1].  We want users to create a file which is the size of
an existing file + some extra amount.  Naturally this would be:

  truncate -r old-disk.img -s +1G new-disk.img

but this does not work and we have to suggest that users use two
separate 'truncate' commands[2].

Related to this feature request, it would be nice if you could suffix
a size with a % sign to indicate that you want to increase a file by a
certain percentage of the old or reference size, eg:

  truncate -r old-disk.img -s +10% new-disk.img

  truncate -r old-disk.img -s 110% new-disk.img

Neither of these forms work at the moment.

Rich.

[1] http://libguestfs.org/virt-resize.1.html#expanding_a_virtual_machine_disk
[2] http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=0e28e4104d96bf0bf5b88fb07bb7e5f9f6e6f41f#patch1

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora


[Message part 3 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: 6268-done <at> debbugs.gnu.org
Subject: Re: bug#6268: Suggestion: truncate should allow -r and -s options
	together
Date: Sat, 29 May 2010 10:44:18 +0100
On 29/05/10 09:21, Jim Meyering wrote:
> Pádraig Brady wrote:
>> Subject: [PATCH] truncate: improve handling of non regular files
>>

> Thanks again.
> This all looks fine.

OK I pushed that with an addition to NEWS.

cheers,
Pádraig.


This bug report was last modified 15 years and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.