ziputil

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(files []*os.File, dest string) error

压缩文件 files 文件数组,可以是不同dir下的文件或者文件夹 dest 压缩文件存放地址

func Compress1

func Compress1(files []*os.File, dest string) error

压缩文件 files 文件数组,可以是不同dir下的文件或者文件夹 dest 压缩文件存放地址

func DeCompress

func DeCompress(zipFile, dest string) error

解压

func IsZip

func IsZip(zipPath string) bool

func Unzip

func Unzip(zipFilePath, destination string) error

Unzip extracts a zip file specified by the zipFilePath to the destination.

func Unzip1

func Unzip1(archive, target string) error

Types

type ZipFile

type ZipFile struct {
	// contains filtered or unexported fields
}

ZipFile represents a zip file.

func Create

func Create(filename string) (z *ZipFile, err error)

Create creates a zip file with the specified filename.

func (*ZipFile) AddDirectory

func (z *ZipFile) AddDirectory(path, dirName string) error

AddDirectory adds a directory.

func (*ZipFile) AddDirectoryN

func (z *ZipFile) AddDirectoryN(path string, names ...string) (err error)

AddDirectoryN adds directories.

func (*ZipFile) AddEntry

func (z *ZipFile) AddEntry(path, name string) (err error)

AddEntry adds a entry.

func (*ZipFile) AddEntryN

func (z *ZipFile) AddEntryN(path string, names ...string) (err error)

AddEntryN adds entries.

func (*ZipFile) Close

func (z *ZipFile) Close() (err error)

Close closes the zip file writer.

Jump to

Keyboard shortcuts

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