• Joe Tsai's avatar
    archive/tar: implement specialized logic for GNU format · ffd9810e
    Joe Tsai authored
    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: 's avatarMartin Möhrmann <moehrmann@google.com>
    ffd9810e
writer.go 15.9 KB