[BusyBox] Unarchive applets; new code overview
Glenn McGrath
bug1 at optushome.com.au
Wed Jun 13 02:04:47 UTC 2001
Adam Heath wrote:
>
> On Mon, 11 Jun 2001, Glenn McGrath,,, wrote:
>
> > I discovered that problem when i modified gunzip, to do a second pass i
> > close the pipes and reopen them from the start, then loop calling
> > getchar() to seek forwards
>
> I hope we don't have tons of loop calling getchar() code all over the place.
> If we need to do skips, we should have some generic code. In fact, if you
> look at cat, you might find something similiar.
>
> In dpkg code, I actually implemented something like this. When I need to
> seek, I call lseek(). If that fails with an invalid argument(ie, ISPIPE), I
> then fall back on a buffer_copy, to /dev/null.
>
There is one loop in extract_archive, the purpose of this function is to
be generic and usable by any of the unarchiving applet. I do see your
point about lseeking when possible to increase performance, i will look
into it.
Glenn
More information about the busybox
mailing list