compress

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

compress

form: https://github.com/artdarek/go-unzip

Wrapper for Zip and 7zip decompression.

Example

package main

import (
	"fmt"

	"github.com/ulib/fsutil/compress"
)

func main() {
	u := compress.NewSevenZip()

	files, err := u.Extract("./data/file.7z", "./data/directory")
	if err != nil {
		panic(err)
	}

	fmt.Printf("extracted files count: %d \n", len(files))
	fmt.Printf("files list: %v \n", files)
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTargetType error = errors.New("ulib.fsutil.compress: the target directory type is file")
)

Functions

func New7Zip added in v0.1.0

func New7Zip(pwd ...string) *sevenZip

Types

type Zip

type Zip struct{}

func NewZip

func NewZip() *Zip

func (Zip) Create added in v0.1.0

func (z Zip) Create(source string, files []string) error

Example:

package main

import (
	"fmt"

	"github.com/3JoB/ulib/fsutil/compress"
	"github.com/3JoB/ulib/fsutil"
)

func main() {
	//Todo:
}

func (Zip) Extract

func (z Zip) Extract(source, destination string) (extractedFiles []string, err error)

Extract files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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