[Toybox] bunzip2 - bzcat as bunzip2

Ashwini Sharma ak.ashwini1981 at gmail.com
Thu Oct 16 22:20:49 PDT 2014


I plan to do this as an alias of bzcat, with changes required to
create/overwrite/error on writing to file.
Restoring the original file modes. As this is all that I need for the
moment.

regards,
Ashwini

On Thu, Oct 16, 2014 at 4:38 PM, Rob Landley <rob at landley.net> wrote:

> On 10/15/14 23:53, Ashwini Sharma wrote:
> > Hi Rob, List,
> >
> > I was looking into 'bzcat' code.
> > Can't this be used as bunzip2 or as __base__ to bunzip2, as I am
> > interested in
> > bunzip2 utility.
> >
> > At a glance it looked to me that it can be used, please share your
> opinion.
>
> Yes, it can.
>
> The only reason I haven't done so yet is busybox tar requires the gunzip
> and bunzip it uses to be built-in, so I can't drop the decompression
> utilities from the busybox config in aboriginal linux (my main test
> harness for toybox) until I switch over to using toybox tar.
>
> Also, I need to implement the relevant compression-side utilities. I
> have about 1/3 of a gzip compressor implemented here (got distracted
> while researching when to do dictionary resets; nobody quite seems to
> agree on that one), and I did half a bzip2 implementation ages ago (the
> fiddly bit is that the string sorting algorithms in the original are
> kind of magic and unexplained; it seems to get constant time out of a
> somewhat arbitrary set of sorting algorithms which give up and fall back
> to the next one after doing a certain amount of work, but I don't
> understand how/why it's set up that way. I need to stare at it some more.)
>
> And then there's the whole "cleanup xz decompression, implement xz
> compression" part to look forward to...
>
> If you want to do a proper bunzip wrapper, be my guest. I did bzcat to
> prove the engine works and left the rest on the todo list. I have a note
> that loopfiles() needs a replace mode so bunzip and sed -i and maybe
> patch can share code, but I can clean that up later. (And I need test
> suite code to check that "bunzip blah.bz2" fails when blah already
> exists...)
>
> > Thanks,
> > Ashwini
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141017/aca25844/attachment-0001.htm>


More information about the Toybox mailing list