unzip

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 11 Imported by: 0

README

Unzip

Build Status GoDoc

Golang *.zip decompress.

Fork from https://github.com/artdarek/go-unzip and remove print, add support for Symlink.

Thank artdarek.

Usage

import "github.com/yi-ge/unzip"

u := unzip.New(filePath, outDir)
err := u.Extract()

Notice

由于 Golang1.12 不再支持 Windows XP,因此使用 Golang 自带的 zip 库将在 XP 系统下发生报错,此库对老版本的支持则是自动下载远程unzip.exe并自动调用http://infozip.sourceforge.net/UnZip.html实现。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileIsExist added in v1.0.2

func FileIsExist(filename string) bool

FileIsExist -判断文件是否存在 存在返回 true 不存在返回false

func GetOsVersion added in v1.0.2

func GetOsVersion() float32

func ReadRemote added in v1.0.2

func ReadRemote(urlString string, hostHeader string, client *http.Client) (b []byte, err error)

ReadRemote - Do GET reuqest. Returns a slice of byte. If the hostHeader string for a module is "" then we use no hostHeader for it.

Types

type Unzip

type Unzip struct {
	Src  string
	Dest string
}

Unzip - struct

func New

func New(src string, dest string) Unzip

New - Create a new Unzip.

func (Unzip) Extract

func (uz Unzip) Extract() error

Extract - Extract zip file.

Jump to

Keyboard shortcuts

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