]> Cypherpunks repositories - gostls13.git/commit
archive/tar: implement specialized logic for GNU format
authorJoe Tsai <joetsai@digital-static.net>
Mon, 14 Aug 2017 07:03:26 +0000 (00:03 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Mon, 14 Aug 2017 21:50:56 +0000 (21:50 +0000)
commitffd9810e5966c8ad972f429866808b73bbefd8bc
tree1f0b25d02f015b3d0e907e07a9d22970f833762b
parentd180d18666e355b52bf12126119416f6b3c6e843
archive/tar: implement specialized logic for GNU format

Rather than going through writeHeader, which attempts to handle all formats,
implement writeGNUHeader, which only has an understanding of the GNU format.

Currently, the implementation is nearly identical to writeUSTARHeader, except:
* formatNumeric is used instead of formatOctal
* the GNU magic value is used

This is kept as a separate method since it makes more logical sense
when we add support for sparse files, long filenames, and atime/ctime fields,
which do not affect USTAR.

Updates #12594

Change-Id: I76efc0b39dc649efc22646dfc9867a7c165f34a8
Reviewed-on: https://go-review.googlesource.com/55237
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
src/archive/tar/writer.go