files

package
v0.0.0-...-6b90055 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPermission

func CheckPermission(src string) bool

CheckPermission 检查文件权限

func DeLFile

func DeLFile(filePath string) error

删除文件

func IsDirExist

func IsDirExist(path string) bool

检查文件夹是否存在

func IsExist

func IsExist(src string) bool

检查文件夹或者文件是否存在

func IsFileExist

func IsFileExist(path string) bool

检查文件是否存在

func MkDir

func MkDir(src string) error

IsNotExistMkDir 如果不存在则新建文件夹 `os.Mkdir` 用于创建一个目录。 `os.MkdirAll` 用于创建一个目录以及它的所有父目录(如果它们不存在的话)

func MoveFile

func MoveFile(src string, dst string) (err error)

@description: 文件移动供外部调用 @param: src string, dst string(src: 源位置,绝对路径or相对路径, dst: 目标位置,绝对路径or相对路径,必须为文件夹)

func Open

func Open(name string, flag int, perm os.FileMode) (*os.File, error)

打开文件

func OpenExistFile

func OpenExistFile(fileName, filePath string) (*os.File, error)

打开文件 不存在则创建

func Unzip

func Unzip(zipFile string, destDir string) ([]string, error)

解压文件

func VisitFile

func VisitFile(root string, visitFile func(path string, f os.FileInfo, err error) error) error

深度遍历目录下的所有文件,包括目录和文件

func WriteFile

func WriteFile(filename string, content string) error

向文件中写入内容

func ZipFiles

func ZipFiles(filename string, files []string, oldForm, newForm string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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