fileutil

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndCreateMkDir

func CheckAndCreateMkDir(path string)

CheckAndCreateMkDir check if exists

func CheckAndCreateMkFile

func CheckAndCreateMkFile(path string)

CheckAndCreateMkFile check if exists

func CheckExist

func CheckExist(src string) bool

CheckExist check if the file exists

func CheckNotExist

func CheckNotExist(src string) bool

CheckNotExist check if the file exists

func CheckPermission

func CheckPermission(src string) bool

CheckPermission check if the file has permission

func DetectContentType

func DetectContentType(filepath string) string

DetectContentType returns the file content-type

func GetExt

func GetExt(fileName string) string

GetExt get the file ext

func GetSize

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

func IsNotExistMkDir

func IsNotExistMkDir(src string) error

IsNotExistMkDir create a directory if it does not exist

func MD5Hex

func MD5Hex(filepath string) string

MD5Hex returns the file md5 hash hex

func MkDir

func MkDir(src string) error

MkDir create a directory

func MkFile

func MkFile(src string) error

func MkFileAll

func MkFileAll(path string) error

func MkFilesPathDir

func MkFilesPathDir(path string) error

func MustOpen

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

MustOpen maximize trying to open the file

func Open

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

Open a file according to a specific mode

func PathExist

func PathExist(path string) bool

func UserHomeAbs

func UserHomeAbs(filename string) string

func Visit

func Visit(dir string, suffix string, visitor func(filename string) error) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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