file

package
v0.0.0-...-1f55c80 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExist

func CheckExist(src string) (bool, error)

CheckExist 检查文件是否存在, 文件存在返回true

func CheckPermission

func CheckPermission(src string) bool

CheckPermission 检查文件权限

func DeleteFile

func DeleteFile(fileName, filePath string) error

DeleteFile 会打开文件,文件路径不存在会创建, 当文件不存在时打开失败

func GetExt

func GetExt(fileName string) string

GetExt 获取文件后缀

func GetSize

func GetSize(f multipart.File) (int, error)

GetSize 获取文件大小

func IsNotExistMkDir

func IsNotExistMkDir(src string) error

IsNotExistMkDir 如果不存在则新建文件夹

func IsToOpen

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

IsToOpen 会打开文件,文件路径不存在会创建, 当文件不存在时打开失败

func MkDir

func MkDir(src string) error

MkDir 新建文件夹

func MustOpen

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

MustOpen 一定会打开文件,文件路径,文件不存在都会创建

func Open

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

Open 打开文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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