archive

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package archive handles collections of files that are either packaged together or compressed.

Index

Constants

View Source
const (
	CreateMode = 0666
)

Variables

View Source
var (
	// ErrNoCustom no customization.
	ErrNoCustom = errors.New("does not support customization")
	// ErrNotArc not an archive.
	ErrNotArc = errors.New("format specified by source filename is not an archive format")
	// ErrSameArgs same same.
	ErrSameArgs = errors.New("name and dest cannot be the same")
	// ErrWalkrFmt cannot walk archive.
	ErrWalkrFmt = errors.New("format specified by archive filename is not a walker format")
)

Functions

func Compress added in v1.1.19

func Compress(files []string, buf io.Writer) []error

func Delete added in v1.1.19

func Delete(files []string) []error

func Extractor added in v1.1.31

func Extractor(src, filename, target, dest string) error

Extractor extracts a file from the given archive file into the destination folder. The archive format is selected implicitly. Archiver relies on the filename extension to determine which decompression format to use, which must be supplied using filename.

func FileCopy

func FileCopy(name, dest string) (written int64, err error)

FileCopy copies a file to the destination.

func FileMove

func FileMove(name, dest string) (written int64, err error)

FileMove copies a file to the destination and then deletes the source.

func FindNFO added in v1.2.3

func FindNFO(name string, files ...string) string

func Proof added in v1.1.31

func Proof(src, filename, uuid string) error

Proof decompresses and parses an archive. uuid is used to rename the extracted assets such as image previews.

func Read

func Read(uuid, name string) ([]string, error)

Read returns a list of files within an rar, tar, zip or 7z archive. uuid is the absolute path to the archive file named as a unique id. filename is the original archive filename and file extension.

func Readr

func Readr(src, filename string) ([]string, error)

Readr returns a list of files within an rar, tar or zip archive. It has offers compatibility with compression formats.

func Restore

func Restore(uuid, name, dest string) ([]string, error)

Restore unpacks or decompresses a given archive file to the destination. The archive format is selected implicitly. Restore relies on the filename extension to determine which decompression format to use, which must be supplied using filename. uuid is the absolute path to the archive file named as a unique id. filename is the original archive filename and file extension.

func Store added in v1.1.19

func Store(files []string, buf io.Writer) []error

func Unarchiver

func Unarchiver(src, filename, dest string) error

Unarchiver unarchives the given archive file into the destination folder. The archive format is selected implicitly. Archiver relies on the filename extension to determine which decompression format to use, which must be supplied using filename.

Types

type Demozoo

type Demozoo struct {
	DOSee string // dosee_run_program column
	NFO   string // retrotxt_readme column
}

Demozoo data extracted from an archive.

func ExtractDemozoo

func ExtractDemozoo(name, uuid string, varNames *[]string) (Demozoo, error)

ExtractDemozoo decompresses and parses archives fetched from Demozoo.org.

func (Demozoo) String

func (d Demozoo) String() string

Jump to

Keyboard shortcuts

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