fileutils

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDirFiles

func GetDirFiles(dir string) ([]string, error)

GetDirFiles 获取目录下的文件 参数 dir: 目录的路径 返回值: 目录下的文件路径(用dir拼接,dir是绝对路径就是绝对路径,dir是相对路径就是相对路径)和错误

func PathExists

func PathExists(path string) bool

PathExists 检查对应路径的文件或目录是否存在 参数: path: 文件或目录的路径 返回值: 对应路径的文件或目录是否存在

func ReadFileWithBuffer added in v1.1.5

func ReadFileWithBuffer(filePath string, bufferSize int, readCallback func(b []byte)) error

ReadFileWithBuffer 带缓冲读文件,一般用于大文件读取 参数 filePath: 文件的路径 bufferSize: 缓冲大小,每次最多读取的字节数 readCallback: 每次读取回调 返回值: 错误

func UnzipBytes

func UnzipBytes(zipFileBytes []byte, destDir string) error

UnzipBytes 解压zip文件 参数 zipFileBytes: zip文件的字节内容 destDir: 解压缩的目的目录 返回值: 错误

func UnzipFile

func UnzipFile(zipFilePath string, destDir string) error

UnzipFile 解压缩zip文件 参数 zipFilePath: zip文件路径 destDir: 解压缩的目的目录 返回值: 错误

func ZipDir

func ZipDir(dirPath string, savePath string) error

ZipDir zip压缩目录 参数 dirPath: 目录的路径 savePath: 生成zip文件的路径 返回值: 错误

Types

This section is empty.

Jump to

Keyboard shortcuts

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