FAQ
https://codereview.appspot.com/6700047/diff/53007/src/pkg/archive/tar/reader.go
File src/pkg/archive/tar/reader.go (right):

https://codereview.appspot.com/6700047/diff/53007/src/pkg/archive/tar/reader.go#newcode179
src/pkg/archive/tar/reader.go:179: nano_buf := string(buf[pos+1:])
On 2013/01/09 19:43:49, rsc wrote:
nanoBuf
Done.

https://codereview.appspot.com/6700047/diff/53007/src/pkg/archive/tar/reader.go#newcode213
src/pkg/archive/tar/reader.go:213: if sp == -1 {
On 2013/01/09 19:43:49, rsc wrote:
sp < 0
Done.

https://codereview.appspot.com/6700047/diff/53007/src/pkg/archive/tar/reader.go#newcode228
src/pkg/archive/tar/reader.go:228: if eq == -1 {
On 2013/01/09 19:43:49, rsc wrote:
eq < 0
Done.

https://codereview.appspot.com/6700047/diff/53007/src/pkg/archive/tar/writer.go
File src/pkg/archive/tar/writer.go (right):

https://codereview.appspot.com/6700047/diff/53007/src/pkg/archive/tar/writer.go#newcode136
src/pkg/archive/tar/writer.go:136: // Decide whether or not to use PAX
extensions
On 2013/01/09 19:43:49, rsc wrote:
Please don't use PAX headers for names that are only 101 bytes long.
An option that should be used before then is to use the split ustar
header form,
in which a prefix of at most 155 bytes appears after the Devminor
bytes. The
full name is prefix + "/" + name. I expect that more readers will be able to
handle this than will know about PAX extensions. I am looking at one
right now.
My suggestion also matches what BSD tar does:
$ tar c
tmp/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/very/long/name
xd -c | sed 200q
0000000 v e r y / v e r y / v e r y / v
0000010 e r y / v e r y / v e r y / v e
0000020 r y / v e r y / v e r y / v e r
0000030 y / v e r y / v e r y / v e r y
0000040 / v e r y / v e r y / v e r y /
0000050 v e r y / v e r y / l o n g / n
0000060 a m e 00 0 0 0 6 4 4 00 0 5 2 4
0000070 5 5 00 0 0 0 0 0 0 00 0 0 0 0
0000080 0 0 0 0 0 0 3 1 2 0 7 3 3 4 3
0000090 4 0 1 0 5 1 5 7 2 00 0 00 00 00
00000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000100 00 u s t a r 00 0 0 r s c 00 00 00 00
0000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000120 00 00 00 00 00 00 00 00 00 w h e e l 00 00
0000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000140 00 00 00 00 00 00 00 00 00 0 0 0 0 0 0
0000150 00 0 0 0 0 0 0 00 t m p / v e r
0000160 y / v e r y / v e r y / v e r y
0000170 / v e r y / v e r y / v e r y /
0000180 v e r y / v e r y / v e r y / v
0000190 e r y / v e r y / v e r y 00 00 00
00001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
(OS X).
I tried the same on Linux and I got a tar file using the GNU
././@LongLink
extension:
0000000 . / . / @ L o n g L i n k 00 00 00
0000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000060 00 00 00 00 0 0 0 0 0 0 0 00 0 0 0 0
0000070 0 0 0 00 0 0 0 0 0 0 0 00 0 0 0 0
0000080 0 0 0 0 2 5 1 00 0 0 0 0 0 0 0 0
0000090 0 0 0 00 0 1 1 5 6 3 00 L 00 00 00
00000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000100 00 u s t a r 00 r o o t 00 00 00
0000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000120 00 00 00 00 00 00 00 00 00 r o o t 00 00 00
0000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000200 t m p / v e r y / v e r y / v e
0000210 r y / v e r y / v e r y / v e r
0000220 y / v e r y / v e r y / v e r y
0000230 / v e r y / v e r y / v e r y /
0000240 v e r y / v e r y / v e r y / v
0000250 e r y / v e r y / v e r y / v e
0000260 r y / v e r y / v e r y / v e r
0000270 y / v e r y / v e r y / v e r y
0000280 / v e r y / v e r y / v e r y /
0000290 v e r y / v e r y / v e r y / l
00002a0 o n g / n a m e 00 00 00 00 00 00 00 00
00002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00002c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00002e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00002f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
In neither case did I get a PAX header. I am worried that nothing generates
PAX headers and therefore nothing will read them. I would rather see either
of these forms (preferably the BSD one, which I believe is more
widespread)
before the PAX header here.
I have no problem with this package reading the PAX stuff, only with
writing it.

I'm not super familiar with bsd. I've downloaded freebsd, and my
experiments seem to indicate that for filenames < 100 characters, you
get a standard tar file. For 100 < len(name) < 255, you get ustar
headers. BSD tar goes ahead and uses pax extensions for larger files. Is
that an acceptable behavior for go?

https://codereview.appspot.com/6700047/

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedJan 11, '13 at 1:52a
activeJan 11, '13 at 1:52a
posts1
users1
websitegolang.org

1 user in discussion

Shanemhansen: 1 post

People

Translate

site design / logo © 2022 Grokbase