archive

package
v0.0.0-...-034ee8e Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

author: linhuadong(scathonlin) creatdate: 2020/12/06

description: tools to compress or uncompress archived file such as gzip, tar, zip. author: linhuadong(scathonlin) date: 2020-12-2 21:44

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GUnzip

func GUnzip(gzipFilePath, gUnzipDir string) error

GUnzip can be used to uncompress gzip file with given gzip file path and target uncompress file.

func Gzip

func Gzip(filePath, gzipFilePath string) error

Gzip create gzip file with specified file

func TarDir

func TarDir(dirToTar, tarFilePath string) (err error)

TarDir create a tar file for directories.

func TarFiles

func TarFiles(filePaths []string, tarFilePath string) error

TarFiles create tar file for multi files.

func UnTar

func UnTar(tarFilePath, unTarDir string) error

UnTar uncompress the tar file to the target dir.

func UnTarGZ

func UnTarGZ(tarGzFilePath, unTarGzDir string) error

UnTarGZ can uncompress the *.tar.gz file to specified dir.

func UnZip

func UnZip(zipFilePath, unZipDir string, maxEntries, limitSize int) error

UnZip can be used to uncompress zip file. 1. maxEntries is be used to symbol the max entry num in the zip file which is counted during unzip procedure, 2. limitSize is be used to symbol the total size of unzip file which is calculated during unzip procedure. the purpose of limitSize and maxEntries is to protect the program from high compression radio file and zip bomb attacks.

func ZipDir

func ZipDir(dirToZip, zipFilePath string) error

ZipDir create zip file for directory.

func ZipFiles

func ZipFiles(filePaths []string, zipFilePath string) error

ZipFiles create zip file for multi files.

Types

This section is empty.

Jump to

Keyboard shortcuts

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