tar

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 8 Imported by: 2

README

tar-utils

standard-readme compliant GoDoc

tar-utils contains utilities for working with tar files generated by go-ipfs to transport UnixFS data

This package originated at https://github.com/whyrusleeping/tar-utils

Lead Maintainer

Adin Schmahmann

Table of Contents

Install

tar-utils works like a regular Go module:

> go get github.com/ipfs/tar-utils

Usage

import "github.com/ipfs/tar-utils"

Check the GoDoc documentation

Contribute

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © Protocol Labs, Inc.

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