archive

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeReg           = tar.TypeReg           // 普通文件
	TypeLink          = tar.TypeLink          // 硬链接
	TypeSymlink       = tar.TypeSymlink       // 符号链接
	TypeChar          = tar.TypeChar          // 字符节点
	TypeBlock         = tar.TypeBlock         // 块节点
	TypeDir           = tar.TypeDir           // 目录
	TypeFifo          = tar.TypeFifo          // 先进先出队列节点
	TypeCont          = tar.TypeCont          // 保留位
	TypeXHeader       = tar.TypeXHeader       // 扩展头
	TypeXGlobalHeader = tar.TypeXGlobalHeader // 全局扩展头
	TypeGNULongName   = tar.TypeGNULongName   // 下一个文件记录有个长名字
	TypeGNULongLink   = tar.TypeGNULongLink   // 下一个文件记录指向一个具有长名字的文件
	TypeGNUSparse     = tar.TypeGNUSparse     // 稀疏文件
)

文件类型

Variables

This section is empty.

Functions

func TarWrite

func TarWrite(files []*File) (buf *bytes.Buffer, err error)

TarWrite 实现了tar格式压缩文件的存取

func ZipWrite

func ZipWrite(files []*File) (buf *bytes.Buffer, err error)

ZipWrite 压缩成zip

Types

type File

type File struct {
	Name string
	Body []byte
}

File 文件

func TarRead

func TarRead(path string) ([]*File, error)

TarRead 读取.tar压缩文件

func ZipRead

func ZipRead(path string) ([]*File, error)

ZipRead 读取zip压缩文件

Jump to

Keyboard shortcuts

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