extract

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 18 Imported by: 0

README

extract issues extract GoDoc

Introducing extract v1.2 - a simple utility and GO library to extract different archive types.

Features

Package extract attempts to make it simple to decompress the compatible archive formats.

The extract command can be ran with no flags to decompress all compatible archive bundles in the current directory in place, or can be ran with -f [archive-file] to point to a specific archive bundle (multiple -f options can be used). A -d [directory] can be used to specify an output directoy.

The extract utility will run up to four extracts concurrently. Previous versions of the tool ran in serial which was somewhat slow.

Supported formats

The following archive/compression types are supported by extract:

  • gzip
  • tar
  • zip
  • rar (without password)
  • bzip
  • More to be added...

GoDoc

See https://pkg.go.dev/github.com/Galzzly/extract

Install

GO

To install the binary directly into your $GOPATH/bin:

go get github.com/Galzzly/extract/cmd/extract

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bzip

func Bzip(src io.Reader, f, dst string, c *WriteCounter) error

func Check

func Check(e error)

func Extract added in v1.3.0

func Extract(fileList []string, destDir string, numC int) (err error)

func GetFileCType

func GetFileCType(out *os.File) (string, error)

GetFileCType is a simplistic way of pulling out the MIMI type of a file. Does not always pull out the type, and will instead replace with application/octet-stream. Particularly when the filie is smaller than 512 bytes. As such, this should not necessarily be relied upon.

func GetFileName

func GetFileName(f string) string

GetFileName will strip the the file name to extract to by removing the suffix. e.g. filename.tar becomes filename

func Gzip

func Gzip(src io.Reader, dst string, c *WriteCounter) error

Extraction of Gzip files

func Rar

func Rar(src io.Reader, dst string, c *WriteCounter) error

func Szip

func Szip(src io.Reader, dst string) error

func Tar

func Tar(src io.Reader, dst string, c *WriteCounter) error

func Zip

func Zip(src, dst string, c *WriteCounter) error

Types

type WriteCounter added in v1.3.0

type WriteCounter struct {
	// contains filtered or unexported fields
}

func (*WriteCounter) Write added in v1.3.0

func (wc *WriteCounter) Write(p []byte) (n int, err error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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