mzip

package
v0.0.0-...-4ece5cd Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2017 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnZip

func UnZip(zipFile io.ReaderAt, size int64, dir string) error

func UnZipFile

func UnZipFile(zipFile string, dir string) error

func ZipAppend

func ZipAppend(dst *zip.Writer, src *zip.Reader, f func(header *zip.FileHeader, r *io.ReadCloser, err error) bool) error

根据压缩文件生成新的压缩文件

func ZipDir

func ZipDir(srcDir string, dstZip *zip.Writer,
	f func(dir string, header *zip.FileHeader, r *io.ReadCloser, err error) bool) error

func ZipFiles

func ZipFiles(dir string, names []string, dstZip io.Writer,
	f func(dir string, header *zip.FileHeader, r *io.ReadCloser, err error) bool) error

压缩指定目录下指定的文件 f 为过滤函数,可修改相应参数。返回 false 表示忽略不压缩这个文件。 如果输入了目录,也会调用 f 函数,这时 r 为[]byte{}。 即使发生读取错误也会调用 f 函数,如果 f 函数未补全缺失的 header 或 r ,zipFiles 函数将中断并返回错误。

Types

This section is empty.

Jump to

Keyboard shortcuts

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