zccompress

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressDirToTargz

func CompressDirToTargz(dirPath, targetTarGzPath string) error

CompressDirToTargz 压缩目录到tar.gz文件

例如: CompressDirToTargz("testdata/testDir", "testdata/XXX.tar.gz")
会将testDir目录完整压缩到testdata/XXX.tar.gz文件中, 且压缩文件中的目录结构根目录为testDir,与testDir目录结构一致。
如果testDir目录结构如下:
testDir
├── subdir1
│   └── testFile1.txt
├── subdir2
└── testFile.txt
则压缩文件中的目录结构为:
testDir
├── subdir1
│   └── testFile1.txt
├── subdir2
└── testFile.txt

func UnCompressTargzToDir

func UnCompressTargzToDir(sourceTarGzPath, dirPath string) error

UnCompressTargzToDir 解压tar.gz文件到目录

例如: UnCompressTargzToDir("testdata/XXX.tar.gz", "testdata/YYY")
会将XXX.tar.gz文件完整解压到testdata/YYY目录中。
如果XXX.tar.gz文件中的目录结构为:
testDir
├── subdir1
│   └── testFile1.txt
├── subdir2
└── testFile.txt
则解压后的目录结构为:
YYY
└── testDir
    ├── subdir1
    │   └── testFile1.txt
    ├── subdir2
    └── testFile.txt

Types

This section is empty.

Jump to

Keyboard shortcuts

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