diff --git a/tar.go b/tar.go index 2c3d006..623b4de 100644 --- a/tar.go +++ b/tar.go @@ -16,6 +16,9 @@ func init() { } type Tar struct { + // If true, use GNU header format + GNU bool + // If true, preserve only numeric user and group id NumericUIDGID bool @@ -87,6 +90,9 @@ func (t Tar) writeFileToArchive(ctx context.Context, tw *tar.Writer, file FileIn if hdr.Name == "" { hdr.Name = file.Name() // assume base name of file I guess } + if t.GNU { + hdr.Format = tar.FormatGNU + } if t.NumericUIDGID { hdr.Uname = "" hdr.Gname = ""