utilsFile

package
v0.0.0-...-7ec6a99 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompressModeStore   = 1
	CompressModeDeflate = 2
)

Variables

This section is empty.

Functions

func MD5

func MD5(filepath string) (string, error)

MD5 计算文件的MD5码

func MkDir

func MkDir(path string) error

func MkDirAll

func MkDirAll(path string) error

func PathExists

func PathExists(path string) (bool, error)

func RmFile

func RmFile(path string) error

func RmFilesUnderDir

func RmFilesUnderDir(dir string) error

func ToBytes

func ToBytes(filepath string) ([]byte, error)

MD5 计算文件的MD5码

func UZipBytes

func UZipBytes(data []byte) []byte

zip解压

func UnzipFile

func UnzipFile(srcFile, dstDir string) error

解压

func WriteBytesSafe

func WriteBytesSafe(filePath string, b []byte) (int, error)

func WriteString

func WriteString(filePath string, s string) (int, error)

func ZipBytes

func ZipBytes(data []byte) []byte

zip压缩

func ZipFile

func ZipFile(sourceFiles []string, zipFilePath string, mode int) error

srcFile could be a single file or a directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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