Documentation ¶
Overview ¶
Package archive handles collections of files that are either packaged together or compressed.
Index ¶
- Variables
- func Compress(files []string, buf io.Writer) []error
- func Copy(name, dest string) (written int64, err error)
- func Delete(files []string) []error
- func Demozoo(src, uuid string, varNames *[]string) (demozoo.Data, error)
- func Extractor(src, filename, target, dest string) error
- func Move(name, dest string) (written int64, err error)
- func NFO(name string, files ...string) string
- func Proof(src, filename, uuid string) error
- func Read(src, name string) ([]string, string, error)
- func Readr(src, filename string) ([]string, string, error)
- func Restore(src, name, dest string) ([]string, error)
- func Store(files []string, buf io.Writer) []error
- func Unarchiver(src, filename, dest string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotArc = errors.New("format specified by source filename is not an archive format")
Functions ¶
func Demozoo ¶
Demozoo decompresses and parses archives fetched from https://demozoo.org.
func Extractor ¶
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 NFO ¶
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 ¶
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 ¶
Read returns both a list of files within an rar, tar, zip or 7z archive; as-well as a suitable filename string for the archive. This filename is useful when the original archive filename has been given an invalid file extension. src is the absolute path to the archive file named as a unique id. name is the original archive filename and file extension.
func Readr ¶
Readr returns both a list of files within an rar, tar or zip archive, and a suitable archive filename string. If there are problems reading the archive due to an incorrect filename extension, the returned filename string will be corrected.
func Restore ¶
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 Unarchiver ¶
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.