Documentation
¶
Overview ¶
Package tar implements access to tar archives.
Index ¶
Constants ¶
const TarSuffix = ".tar"
TarSuffix represents the tar suffix.
const TargzSuffix = ".tar.gz"
TargzSuffix represents the tar gzip suffix.
Variables ¶
var ErrTooManyArgs = errors.New("too many arguments")
ErrTooManyArgs is returned when the arguments length is bigger than 1.
Functions ¶
Types ¶
type Reader ¶
Reader provides sequential access to the contents of a tar archive.
func NewFileReader ¶
NewFileReader creates a new Reader reading from file.
func NewGzipFileReader ¶
NewGzipFileReader creates a new gzip Reader reading from file.
func NewGzipReader ¶
NewGzipReader creates a new gzip Reader reading from r.
type Writer ¶
Writer provides sequential writing of a tar archive.
func NewFileWriter ¶
NewFileWriter creates a new Writer writing to file.
func NewGzipFileWriter ¶
NewGzipFileWriter creates a new gzip Writer writing to file.
func NewGzipWriter ¶
NewGzipWriter creates a new gzip Writer writing to w.
func (*Writer) Close ¶
Close closes the tar archive by flushing the padding, and writing the footer. If the current file (from a prior call to WriteHeader) is not fully written, then this returns an error.
func (*Writer) Flush ¶
Flush finishes writing the current file's block padding. The current file must be fully written before Flush can be called.
This is unnecessary as the next call to WriteHeader or Close will implicitly flush out the file's padding.