files

package
v0.0.0-...-021ab65 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Home = "~"
View Source
const HomePath = Home + PathSeparator
View Source
const PathSeparator = string(filepath.Separator)

Variables

This section is empty.

Functions

func Abs

func Abs(name string) string

Abs returns the full path of a file or directory, "~" is replaced with home.

func AbsolutePath

func AbsolutePath() string

AbsolutePath 获取程序目录的绝对路径

func Copy

func Copy(src, dst string) error

Copy 文件拷贝,将src拷贝到dst

func CopyFile

func CopyFile(src, dst string) error

func DirIsNull

func DirIsNull(dirPath string) bool

func IsDir

func IsDir(path string) bool

IsDir 判断是否是目录

func IsExist

func IsExist(f string) bool

IsExist 判断文件或目录是否存在

func MakeDir

func MakeDir(_dir string) bool

MakeDir 创建目录

func ReadDir

func ReadDir(path string) ([]string, error)

ReadDir 读取目录下的文件

func ReadFile

func ReadFile(_file string) string

ReadFile 读取文件

func Rewrite

func Rewrite(oldPath, newPath string) error

func UnZip

func UnZip(zipFile, dstDir string) (string, error)

UnZip 解压文件到指定文件夹

func WriteFile

func WriteFile(path, data string) bool

WriteFile 写文件

func WriteFileAppend

func WriteFileAppend(path, data string) bool

WriteFileAppend 追加的方式写文件

func Zip

func Zip(srcFile string, destZip string) error

Zip 压缩srcFile为压缩文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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