Documentation ¶
Index ¶
- Constants
- func CreateFile(fpath string, filePerm, dirPerm os.FileMode) (*os.File, error)
- func DeleteIfFileExist(fpath string) error
- func FileExists(path string) bool
- func IsAbsPath(filepath string) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsImageFile(path string) bool
- func IsZipFile(filepath string) bool
- func MimeType(path string) (mime string)
- func Mkdir(dirPath string, perm os.FileMode) error
- func PathExists(path string) bool
- func ReaderMimeType(r io.Reader) (mime string)
- func Unzip(archive, targetDir string) (err error)
Constants ¶
View Source
const (
// sniff Length, use for detect file mime type
MimeSniffLen = 512
)
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists reports whether the named file or directory exists. Deprecated
please use PathExists() or IsFile() instead it
func IsZipFile ¶
IsZipFile check is zip file. from https://blog.csdn.net/wangshubo1989/article/details/71743374
func PathExists ¶
PathExists reports whether the named file or directory exists.
func ReaderMimeType ¶
ReaderMimeType get the io.Reader mimeType Usage:
file, err := os.Open(filepath) if err != nil { return } mime := ReaderMimeType(file)
func Unzip ¶
Unzip a zip archive from https://blog.csdn.net/wangshubo1989/article/details/71743374
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.