Russell Coker 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.

There is always 'head'.

  head --bytes=1024m

But that does still perform 1G x 2 of I/O.

Let me guess.  You have a partially downloaded image with a corrupted
part at the end that you want to modify so that the download can
resume from a known good state?

> I think it would be ideal to have a program as part of coreutils that allows
> you to resize a file.  If the new length is longer than the old length then
> it would either write zeros to the end or extend the file (with a hole)
> via the truncate() system call according to the wish of the user.  If the new
> length is shorter then it would just call truncate().

I think the functionality is interesting but don't know where the best
place to locate it.  The dd program actually does seem like a good
place for this to go.  I think I would favor putting it there.  But
otherwise a completely new program with general file handling features
might not be a bad idea.  Many of the existing programs already have a
large amount of bloat and it is better not to keep dumping the kitchen
sink of things into them.

> I would be happy to contribute the code for this.  This will require some
> discussion with upstream, but it seemed best to start the discussion here.

Actually the general consensus has been that Debian should try to
avoid unique downstream patches as much as possible.  Therefore I
suggest that this discussion be taken upstream.  Let me encourage you
to discuss this upstream on the [EMAIL PROTECTED] mailing list.

For upstream contribution the FSF will require a copyright assignment.
If you can submit one then I am sure that patches and contributions
would be both appreciated and seriously considered.  But if you are
unable to do that then it is much better simply to suggest ideas and
to let someone else with a copyright assignment actually submit the
code patches.  I am sure you know this already but worst case is that
someone submits an absolutely perfect bit of code that does exactly
what is needed but without a copyright assignment it can't be used.
It might even be necessary to even code things less well in order to
avoid conflict with the submitted code which can't be used.  It's a
pain but recent court cases have shown that this diligence is needed
to keep the clear trail so that free software can remain free.  It is
really more important now than ever.  As I said I am sure that you
already know all of that but I felt compelled to say it anyway.

Bob



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to