iohelper

package module
v0.0.0-...-07fd573 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package iohelper Date: 2022/9/7 00:43 Author: Amu Description:

Package iohelper Date: 2023/3/28 17:14 Author: Amu Description:

Package iohelper Date: 2023/3/28 17:13 Author: Amu Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, des string) error

func DeleteFile

func DeleteFile(absPath string) error

DeleteFile 删除文件

func EnsureDir

func EnsureDir(dir string) error

EnsureDir 确保目录存在,如果不存在则创建

func FileExist

func FileExist(absPath string) bool

FileExist 检查文件是否存在

func FileMD5

func FileMD5(filename string) (string, error)

FileMD5 计算文件的 md5

func GetFileSize

func GetFileSize(filename string) (int64, error)

GetFileSize 获取文件大小

func GetPathDirs

func GetPathDirs(absDir string) (re []string)

GetPathDirs 获取指定目录下的所有文件夹

func GetPathFiles

func GetPathFiles(absDir string) (re []string)

GetPathFiles 获取指定目录下的所有文件

func GetPwd

func GetPwd() string

GetPwd 获取程序运行目录

func MakeDir

func MakeDir(absDir string) error

MakeDir 创建目录

func MoveFile

func MoveFile(from, to string) error

MoveFile 移动文件或文件夹(/结尾)

func PathExist

func PathExist(dir string) bool

PathExist 检查目录是否存在

func ReadFile

func ReadFile(fname string) (src []string)

ReadFile 读取文件

func SaveToFile

func SaveToFile(fname string, src []string, isClear bool) bool

SaveToFile 写入文件 isClear false 追加写入 true 覆盖写入

func WriteFile

func WriteFile(fname string, src []string, isClear bool) bool

WriteFile 写入文件

Types

type CheckTextMd5

type CheckTextMd5 struct {
	// contains filtered or unexported fields
}

func NewCheckTextMd5

func NewCheckTextMd5(fileName, fileText, md5FilePath, md5Name string) *CheckTextMd5

NewCheckTextMd5 fileName 和 fileText 人选一个传入, md5Name 是 md5 文件名称

func (*CheckTextMd5) Change

func (s *CheckTextMd5) Change() bool

func (*CheckTextMd5) Write

func (s *CheckTextMd5) Write() error

Jump to

Keyboard shortcuts

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