iutils

package module
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 10 Imported by: 0

README

iutils

go get -u github.com/MDGSF/iutils
go get -u github.com/MDGSF/[email protected]

test

go test ./...
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcFileMD5

func CalcFileMD5(filename string) (string, error)

CalcFileMD5 计算并返回指定文件的MD5哈希值

func DirExists

func DirExists(path string) bool

func FileExists

func FileExists(path string) bool

func FindFilesWithExt added in v0.0.11

func FindFilesWithExt(dirPath, ext string) ([]string, error)

func GenerateRandomString

func GenerateRandomString(length int) string

func GetFileSize

func GetFileSize(filename string) (int64, error)

func IsTargetExt added in v0.0.11

func IsTargetExt(info fs.DirEntry, ext string) bool

func ReadFile

func ReadFile(filename string) ([]byte, error)

func ReadFileParts

func ReadFileParts(filename string, fileoffset int64, length int64) ([]byte, error)

func WriteFile

func WriteFile(filename string, data []byte) error

func WriteFile2

func WriteFile2(filename string, data []byte) error

writeFile 自动创建目录并写入文件

func WriteFile3

func WriteFile3(filename string, data []byte) error

WriteFile writes data to the file specified by filename. It uses a temporary file for safety and ensures data is flushed to disk.

func WriteFileParts

func WriteFileParts(
	filename string,
	fileoffset int64,
	data []byte,
) error

func WriteJson

func WriteJson(filename string, data interface{}) error

func WriteScript

func WriteScript(filename string, data []byte) error

Types

This section is empty.

Directories

Path Synopsis
zeroutils

Jump to

Keyboard shortcuts

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