file

package
v2.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPermission

func CheckPermission(src string) bool

获取一个文件是否有权限

func CopyDir

func CopyDir(source string, dest string) (err error)

将source目录复制到dest目录

func CopyFile

func CopyFile(source string, dest string) (err error)

将source文件复制到dest文件

func ExtIsImg

func ExtIsImg(extension string) bool

判断扩展名是否为图像

func GetAllFile added in v2.1.8

func GetAllFile(pathname string, allowExt []string) (res []string, err error)

获取文件夹中符合拓展名的文件

func GetAppCurrentPath

func GetAppCurrentPath() (string, error)

获取应用的运行目录

func GetExt

func GetExt(fileName string) string

获取一个文件的拓展名

func GetFileSize

func GetFileSize(path string) int64

获取一个文件的字节长度

func IsDir

func IsDir(path string) bool

判断指定的路径是否为目录

func IsExist

func IsExist(path string) bool

判断一个文件或文件夹是否存在

func IsNotExistMkDir

func IsNotExistMkDir(src string) error

判断一个文件夹是否存在,不存在则创建

func MkDir

func MkDir(src string) error

创建一个文件夹

func MustOpen

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

最大可能打开一个文件

func Open

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

根据特定模式打开文件

func ReadFile added in v2.1.2

func ReadFile(fileName string) (string, error)

读取文件

func WriteFile added in v2.1.2

func WriteFile(b []byte, file string) error

写出文件

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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