tarUtil

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTar

func ExtractTar(tarFileName, extractDir string) error

ExtractTar 解压指定的TAR文件到目标目录。 参数:

  • tarFileName: 需要解压的TAR文件路径。
  • extractDir: 解压目标目录。

返回:

  • error: 操作过程中遇到的错误。

func Tar

func Tar(tarPath string, paths ...string) error

Tar 将指定路径打包为tar文件。 参数:

  • tarPath: 目标TAR文件路径。
  • paths: 需要打包的目录或文件路径列表。

返回:

  • error: 操作过程中遇到的错误。

注意:如果TAR文件已存在,会保留原有文件内容并追加新文件。

func TarCover

func TarCover(tarPath string, paths ...string) error

TarCover 将指定路径打包为tar文件(覆盖模式)。 参数:

  • tarPath: 目标TAR文件路径。
  • paths: 需要打包的目录或文件路径列表。

返回:

  • error: 操作过程中遇到的错误。

注意:如果TAR文件已存在,将完全覆盖原有内容。

Types

This section is empty.

Jump to

Keyboard shortcuts

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