tzst

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tzst provides methods for unpacking tar.zst files

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrNilReader = fmt.Errorf("Reader can not be nil")

Functions

func Read added in v1.1.0

func Read(r io.Reader, dir string) error

Read reads compressed data using given reader and unpacks it to the given directory

Example
file := "file.tzst"
fd, err := os.OpenFile(file, os.O_RDONLY, 0)

if err != nil {
	fmt.Printf("Error: Can't unpack %s: %v\n", file, err)
	return
}

err = Read(fd, "/home/bob/data")

if err != nil {
	fmt.Printf("Error: Can't unpack %s: %v\n", file, err)
	return
}

fmt.Printf("File %s successfully unpacked!\n", file)
Output:

func Unpack

func Unpack(file, dir string) error

Unpacks file to given directory

Example
file := "file.tzst"
err := Unpack(file, "/home/bob/data")

if err != nil {
	fmt.Printf("Error: Can't unpack %s: %v\n", file, err)
	return
}

fmt.Printf("File %s successfully unpacked!\n", file)
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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