tar

package
v0.16.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct {
	Path     string
	Progress func(int64) int64
}

Extractor is used for extracting tar files to a filesystem.

The Extractor can only extract tar files containing files, directories and symlinks. Additionally, the tar files must either have a single file, or symlink in them, or must have all of its objects inside of a single root directory object.

If the tar file contains a single file/symlink then it will try and extract it with semantics similar to Linux's `cp`. In particular, the name of the extracted file/symlink will match the extraction path. If the extraction path is a directory then it will extract into the directory using its original name.

Overwriting: Extraction of files and symlinks will result in overwriting the existing objects with the same name when possible (i.e. other files, symlinks, and empty directories).

func (*Extractor) Extract

func (te *Extractor) Extract(reader io.Reader) error

Extract extracts a tar file to the file system. See the Extractor for more information on the limitations on the tar files that can be extracted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL