archive

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var ErrNotArc = errors.New("format specified by source filename is not an archive format")

Functions

func Compress

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

Compress a collection of files using gzip and add them to the tar writter.

func Copy

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

Copy copies a file to the destination.

func Delete

func Delete(files []string) []error

Delete removes the collection of files from the host filesystem.

func Demozoo

func Demozoo(src, uuid string, varNames *[]string) (demozoo.Data, error)

Demozoo decompresses and parses archives fetched from https://demozoo.org.

func Extractor

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 Move

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

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

func NFO

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

NFO attempts to discover a archive package NFO or information textfile from a collection of files. For better results the name of the archive file should be provided.

func Proof

func Proof(src, filename, uuid string) error

Proof decompresses and parses a hosted file archive. src is the path to the file including the uuid filename. filename is the original archive filename, usually kept in the database. uuid is used to rename the extracted assets such as image previews.

func Read

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

Read returns a list of files within an rar, tar, zip or 7z archive. src 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(src, 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. src is the absolute path to the archive file named as a unique id. filename is the original archive filename and file extension.

func Store

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

Store adds collection of files to the tar writter.

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

This section is empty.

Directories

Path Synopsis
internal
arc

Jump to

Keyboard shortcuts

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