archive/tar: Added support for GNU sparse files.
Supports all the current GNU tar sparse formats, including the
old GNU format and the GNU PAX format versions 0.0, 0.1, and 1.0.
Fixes issue 3864.
https://codereview.appspot.com/64740043/diff/80001/src/pkg/archive/tar/reader.go File src/pkg/archive/tar/reader.go (right): https://codereview.appspot.com/64740043/diff/80001/src/pkg/archive/tar/reader.go#newcode111 src/pkg/archive/tar/reader.go:111: mergePAX(hdr, headers) The call to tr.skipUnread() or the call ...
10 years, 2 months ago
(2014-02-17 14:04:22 UTC)
#4
10 years, 2 months ago
(2014-02-17 21:09:09 UTC)
#5
https://codereview.appspot.com/64740043/diff/60001/src/pkg/archive/tar/reader.go
File src/pkg/archive/tar/reader.go (right):
https://codereview.appspot.com/64740043/diff/60001/src/pkg/archive/tar/reader...
src/pkg/archive/tar/reader.go:516: rfr := ®FileReader{r: tr.r, nb: nb}
On 2014/02/16 23:49:11, dfc wrote:
> why create a new var here ? why not
>
> tr.curr = ®FileReader{....}
Done.
https://codereview.appspot.com/64740043/diff/60001/src/pkg/archive/tar/reader...
src/pkg/archive/tar/reader.go:531: tr.curr = &sparseFileReader{rfr: rfr, sp: sp,
tot: hdr.Size}
On 2014/02/17 01:33:46, davidthomas wrote:
> On 2014/02/16 23:49:11, dfc wrote:
> > then it is clear that you are wrapping the old reader
> > tr.curr = &sparceFileReader{rfr: tr.curr, ...}
> The types don't line up. It would have to be
> tr.curr = &sparseFileReader{rfr: tr.curr.(*regFileReader), ...}
> Alternatively, sparseFileReader could have a numBytesReader (interface) field
> instead of a regFileReader field.
Done.
Issue 64740043: code review 64740043: archive/tar: Added support for GNU sparse files.
Created 10 years, 2 months ago by davidthomas
Modified 10 years, 1 month ago
Reviewers: gobot
Base URL:
Comments: 30