fileutil

package
v0.0.0-...-bcd2c7c Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JPEG = "jpeg"
	JPG  = "jpg"
	PNG  = "png"
	GIF  = "gif"
	TIF  = "tif"
	BMP  = "bmp"
	XLS  = "xls"
	XLSX = "xlsx"
	GO   = "golang"
)

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) (int64, error)

Copy copy a file from src to dst

func FindFilesByPrefix

func FindFilesByPrefix(dirPath, prefix string) (files []string, err error)

func GetFileType

func GetFileType(f *os.File) (fileType string, err error)

GetFileType get the file type by the top several bytes

func GetFileTypeByFileBytes

func GetFileTypeByFileBytes(data []byte) (fileType string)

判断文件的类型 data: 文件流前十字节, 未找到类型fileType == ""

func MakeDirAll

func MakeDirAll(dir string, perm os.FileMode) error

生成多级文件目录 mkdir -p

func MakeHashDir

func MakeHashDir(key string) (hashDir string)

根据文件名生成目录

func RemoveAll

func RemoveAll(fileNames []string) error

func Split

func Split(filepath string) (dir, file, ext string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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