Documentation ¶
Overview ¶
Package sys uses programs installed to the host operating system to handle miscellaneous archives not usable with the Go packages.
Index ¶
- Variables
- func ARJExtract(src, targets, dest string) error
- func ARJItem(s string) bool
- func ARJReader(src string) ([]string, string, error)
- func Extract(filename, src, targets, dest string) error
- func LHAExtract(src, targets, dest string) error
- func LHAReader(src string) ([]string, string, error)
- func MagicExt(src string) (string, error)
- func MagicLHA(magic string) bool
- func RarReader(src string) ([]string, string, error)
- func Readr(w io.Writer, src, filename string) ([]string, string, error)
- func Rename(ext, filename string) string
- func ZipExtract(src, targets, dest string) error
- func ZipReader(w io.Writer, src string) ([]string, string, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrDest = errors.New("dest directory points to a file") ErrMagic = errors.New("no unsupport for magic file type") ErrProg = errors.New("archive program error") ErrReadr = errors.New("system could not read the file archive") ErrTypeOut = errors.New("magic file program result is empty") ErrSilent = errors.New("archiver program silently failed, it return no output or errors") ErrWrongExt = errors.New("filename has the wrong file extension") ErrUnknownExt = errors.New("the archive uses an unsupported file extension") )
Functions ¶
func ARJExtract ¶ added in v1.11.0
ARJExtract extracts the targets from the src ARJ archive to the dest directory using the Linux arj program.
func ARJReader ¶ added in v1.11.0
ARJReader returns the content of the src ARJ archive. There is an internal limit of 999 items.
func Extract ¶
Extract the targets from the src file archive to the dest directory using an Linux archive program. The program used is determined by the extension of the provided archive filename, which maybe different to src.
func LHAExtract ¶ added in v1.11.0
LHAExtract extracts the targets from the src LHA/LZH archive to the dest directory using a Linux lha program. Either jlha-utils or lhasa work. Targets with spaces in their names are ignored by the program.
func MagicExt ¶
MagicExt uses the Linux file program to determine the src archive file type. The returned string will be a file separator and extension. Note both bzip2 and gzip archives return a .tar extension prefix.
func Readr ¶
Readr attempts to use programs on the host operating system to determine the src archive content and a usable filename based on its format.
func Rename ¶
Rename the filename by replacing the file extension with the ext string. Leaving ext empty returns the filename without a file extension.
func ZipExtract ¶
ZipExtract extracts the target filenames from the src ZIP archive to the dest directory using the Linux unzip program. Multiple filenames can be separated by spaces.
Types ¶
This section is empty.