ziputil

package
v0.0.0-...-8b05944 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

ziputil.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToZip

func AddToZip(zipPath, filePath string) error

AddToZip 向现有ZIP文件添加文件

func CompressToZip

func CompressToZip(src, dest string) error

CompressToZip 压缩文件或目录到ZIP文件

func ExtractFile

func ExtractFile(zipPath, fileName, destPath string) error

ExtractFile 从ZIP中提取单个文件

func ExtractZip

func ExtractZip(src, dest string) error

ExtractZip 解压ZIP文件到指定目录

Types

type FileInfo

type FileInfo struct {
	Name           string
	Size           int64
	CompressedSize int64
	ModTime        time.Time
	IsDir          bool
	Method         uint16
}

FileInfo ZIP文件信息结构体

func ListZipContents

func ListZipContents(zipPath string) ([]FileInfo, error)

ListZipContents 列出ZIP文件内容

func (FileInfo) String

func (f FileInfo) String() string

String 实现Stringer接口

type ZipInfo

type ZipInfo struct {
	Path           string
	FileCount      int
	DirCount       int
	TotalSize      int64
	CompressedSize int64
}

ZipInfo ZIP文件信息

func GetZipInfo

func GetZipInfo(zipPath string) (*ZipInfo, error)

GetZipInfo 获取ZIP文件基本信息

func (ZipInfo) String

func (z ZipInfo) String() string

String 实现Stringer接口

Jump to

Keyboard shortcuts

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