extract

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 12 Imported by: 0

README

extract issues extract GoDoc

Introducing extract v1 - 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.

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) error

func Check

func Check(e 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) error

Extraction of Gzip files

func Rar

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

func Szip

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

func Tar

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

func Zip

func Zip(src, dst string) error

Types

This section is empty.

Directories

Path Synopsis
cmd
extract command

Jump to

Keyboard shortcuts

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