archive/tar unable to read its own output?

67 views
Skip to first unread message

Maxim Khitrov

unread,
Nov 6, 2012, 7:57:34 PM11/6/12
to golang-nuts
Hello,

Please take a look at the following demo, which is basically a copy of
the examples from archive/tar package documentation:

http://play.golang.org/p/npEgUjWE8I

If you uncomment ModTime field on line 23, the error goes away. As far
as I can tell, tar.Reader does not properly decode binary numeric
fields. If you write a Header without setting ModTime, the encoded
value is written using the binary format instead of octal. The Reader
only tries to decode octal values, so reading that record results in
ErrHeader error.

It seems strange to me that the Writer supports binary output, while
the Reader does not. Is there a reason for this? I would at least
update the package examples, because they do not seem to work in the
current form.

- Max

David Symonds

unread,
Nov 6, 2012, 8:04:03 PM11/6/12
to Maxim Khitrov, golang-nuts
Sounds like a bug. Want to file an issue?

Maxim Khitrov

unread,
Nov 6, 2012, 9:03:05 PM11/6/12
to David Symonds, golang-nuts
On Tue, Nov 6, 2012 at 8:04 PM, David Symonds <dsym...@golang.org> wrote:
> Sounds like a bug. Want to file an issue?

Done: https://code.google.com/p/go/issues/detail?id=4358

- Max
Reply all
Reply to author
Forward
0 new messages