Documentation ¶
Overview ¶
Package os extend the standard os package to provide additional functionalities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrExtractInputExt = errors.New("unknown extract input extension")
)
Functions ¶
func Extract ¶
Extract uncompress and/or unarchive file from fileInput into directory defined by dirOutput. This is the high level API that combine standard archive/zip, archive/tar, compress/bzip2, and/or compress/gzip.
The compression and archive format is detected automatically based on the following fileInput extension:
- .bz2: decompress using compress/bzip2.
- .gz: decompress using compress/gzip.
- .tar: unarchive using archive/tar.
- .zip: unarchive using archive/zip.
- .tar.bz2: decompress using compress/bzip2 and unarchive using archive/tar.
- .tar.gz: decompresss using compress/gzip and unarchive using archive/tar.
The output directory, dirOutput, where the decompressed and/or unarchived file stored will be created if not exist. If its empty, it will set to current directory.
On success, the compressed and/or archived file will be removed from the file system.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.