Re: Bug#467378: coreutils: Please include a program to truncate files

2008-03-28 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pádraig, thanks for this. I know that I, at least, would have benefitted from such a tool while testing certain filesize-related issues for Wget. I wrote a quick ten-liner for the purpose on those occasions, but of course it's great to have a proper t

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-03-28 Thread Jim Meyering
Jim Meyering <[EMAIL PROTECTED]> wrote: > Pádraig Brady <[EMAIL PROTECTED]> wrote: >> Take 2 attached > > Thanks! > I've looked through the tests (thanks for writing so many!) > marked a few things with FIXME comments, fixed some "exit..." lines > (that matters for portability wrt traps), BTW, I'

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-03-28 Thread Jim Meyering
Pádraig Brady <[EMAIL PROTECTED]> wrote: > Take 2 attached Thanks! I've looked through the tests (thanks for writing so many!) marked a few things with FIXME comments, fixed some "exit..." lines (that matters for portability wrt traps), and adjusted nit-picky comment syntax ;-) Here are a few mor

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-03-26 Thread Pádraig Brady
Take 2 attached >From 345b3af13f3e44d365535b93691ae897b5512805 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?P=C3=A1draig=20Brady?= <[EMAIL PROTECTED]> Date: Thu, 27 Mar 2008 01:11:25 + Subject: [PATCH] Add new program: truncate * AUTHORS: Register as the author * NEWS: Mention this change * README

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-03-26 Thread Jim Meyering
Pádraig Brady <[EMAIL PROTECTED]> wrote: > Subject: [PATCH] Add new program: truncate Nice! Thanks for doing all that. Here's a first pass: - fix a typo s/tound/round/ : > [EMAIL PROTECTED] => tound up to multiple of - please indent using only spaces (no TABs) and add this at the end of

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-03-26 Thread Pádraig Brady
Proposed truncate command attached >From 34b9bc72ffe70ec83710b12021e889d5ae65e508 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?P=C3=A1draig=20Brady?= <[EMAIL PROTECTED]> Date: Wed, 26 Mar 2008 14:03:31 + Subject: [PATCH] Add new program: truncate * AUTHORS: Register as the author. * NEWS: Mention

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-26 Thread Pádraig Brady
Russell Coker wrote: > On Tuesday 26 February 2008 21:03, Pádraig Brady <[EMAIL PROTECTED]> wrote: >>> That depends on your definition of "works". >>> If you don't mind retaining the first 2GiB of content in >>> a preexisting output file, then it works fine. But the initial >>> truncation is requi

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-26 Thread Russell Coker
On Tuesday 26 February 2008 21:03, Pádraig Brady <[EMAIL PROTECTED]> wrote: > > That depends on your definition of "works". > > If you don't mind retaining the first 2GiB of content in > > a preexisting output file, then it works fine. But the initial > > truncation is required if you want to be s

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-26 Thread Pádraig Brady
Jim Meyering wrote: > Paul Eggert <[EMAIL PROTECTED]> wrote: >> Jim Meyering <[EMAIL PROTECTED]> writes: >>> If you don't mind truncating first, how about this? >>> >>> true > /var/spool/whatever/foo >>> dd bs=1 seek=2G of=/var/spool/whatever/foo < /dev/null >> Also, the latter command work

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-26 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: >> If you don't mind truncating first, how about this? >> >> true > /var/spool/whatever/foo >> dd bs=1 seek=2G of=/var/spool/whatever/foo < /dev/null > > Also, the latter command works even if the former comma

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-25 Thread Russell Coker
On Tuesday 26 February 2008 10:08, Paul Eggert <[EMAIL PROTECTED]> wrote: > > dd bs=1 seek=2G of=/var/spool/whatever/foo < /dev/null > > Also, the latter command works even if the former command is omitted. > That is, by itself, that invocation of dd resizes > /var/spool/whatever/foo to 2 GiB,

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-25 Thread Russell Coker
On Monday 25 February 2008 22:11, Jim Meyering <[EMAIL PROTECTED]> wrote: > > One non-obvious feature request that I have is for a truncate on a > > non-existant file to create it (similar to the way "touch" is commonly > > used to create files). > > The obvious question is then "Why?" One specifi

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-25 Thread Russell Coker
On Monday 25 February 2008 21:29, Pádraig Brady <[EMAIL PROTECTED]> wrote: > Russell if you want to push code to me it's fine, > but I was going to work on this tool anyway. I don't have any code (yet). If you are going to work on it then I would be more than happy to leave it to you. I would b

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-25 Thread Paul Eggert
Jim Meyering <[EMAIL PROTECTED]> writes: > If you don't mind truncating first, how about this? > > true > /var/spool/whatever/foo > dd bs=1 seek=2G of=/var/spool/whatever/foo < /dev/null Also, the latter command works even if the former command is omitted. That is, by itself, that invocat

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-25 Thread Jim Meyering
Russell Coker <[EMAIL PROTECTED]> wrote: > On Monday 25 February 2008 22:11, Jim Meyering <[EMAIL PROTECTED]> wrote: >> > One non-obvious feature request that I have is for a truncate on a >> > non-existant file to create it (similar to the way "touch" is commonly >> > used to create files). >> >>

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-25 Thread Jim Meyering
Russell Coker <[EMAIL PROTECTED]> wrote: > On Monday 25 February 2008 21:29, Pádraig Brady <[EMAIL PROTECTED]> wrote: >> Russell if you want to push code to me it's fine, >> but I was going to work on this tool anyway. > > I don't have any code (yet). If you are going to work on it then I would be

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-25 Thread Pádraig Brady
Jim Meyering wrote: > Russell Coker <[EMAIL PROTECTED]> wrote: >> If I have a file that is 2G in size but wish to discard the last 1G of data >> then there seems to be no program available to do this. >> >> I think it would be ideal to have a program as part of coreutils that allows >> you to resiz

Re: Bug#467378: coreutils: Please include a program to truncate files

2008-02-24 Thread Jim Meyering
Russell Coker <[EMAIL PROTECTED]> wrote: > If I have a file that is 2G in size but wish to discard the last 1G of data > then there seems to be no program available to do this. > > I think it would be ideal to have a program as part of coreutils that allows > you to resize a file. If the new lengt