file_utils

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTarArchive added in v1.0.9

func CreateTarArchive(src, dest string) error

CreateTarArchive 创建 TAR 文件

func CreateZipArchive added in v1.0.9

func CreateZipArchive(src, dest string) error

CreateZipArchive 创建zip

func DecompressGzip added in v1.0.9

func DecompressGzip(src, dest string) error

DecompressGzip 解压 gzip 文件

func Replace

func Replace(source, target string) (string, error)

Replace 函数,用于替换源文件到目标文件

func TraverseDirFiles

func TraverseDirFiles(dir string, recursive bool) ([]*FileData, []*FileData, error)

TraverseDirFiles 函数,遍历给定目录并返回文件路径列表 `recursive` 参数表明是否递归遍历子目录

Types

type FileData

type FileData struct {
	Path     string
	PathBuf  string
	AbsPath  string
	Filename string
	Metadata os.FileInfo
}

FileData 结构体定义

func CreateDirectory

func CreateDirectory(path string) (*FileData, error)

CreateDirectory 函数,用于创建文件夹

func NewFileData

func NewFileData(path string) (*FileData, error)

NewFileData 函数,用于创建 FileData 实例

Jump to

Keyboard shortcuts

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