xfile

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) error

Copy ...

func GetFileDir

func GetFileDir(filepath string) string

GetFileDir

@Description: 获取文件所在目录
@param filepath
@return string

func GetFileExt

func GetFileExt(file string) string

GetFileExt

@Description: 获取文件扩展名
@param file
@return string

func GetFileName

func GetFileName(filepath string) string

GetFileName

@Description: 获取文件名
@param filepath
@return string

func GetFileNameWithoutExt

func GetFileNameWithoutExt(filepath string) string

GetFileNameWithoutExt

@Description: 获取不带文件扩展名的文件名
@param filepath
@return string

func GetFilePathWithoutExt

func GetFilePathWithoutExt(filepath string) string

GetFilePathWithoutExt

@Description: 文件路径去除文件扩展名
@param filepath
@return string

func IsDir

func IsDir(filepath string) bool

IsDir

@Description: 路径是否是目录
@param filepath 路径
@return bool

func IsExist

func IsExist(filepath string) bool

IsExist

@Description: 文件路径是否存在
@param filepath 路径
@return bool

func IsFile

func IsFile(filepath string) bool

IsFile ...

@Description: 路径是否是文件类型
@param filepath 路径
@return bool

func IsImage

func IsImage(filepath string) bool

IsImage

@Description: 路径是否是图片类型
@param filepath 路径
@return bool

func LineCount

func LineCount(filepath string) int

LineCount ...

func Md5

func Md5(path string) (string, error)

Md5 file md5

func MineType

func MineType(filepath string) string

MineType ...

func Read

func Read(filepath string) string

Read ...

func ReadJSON

func ReadJSON(filepath string, data interface{}) error

ReadJSON read JSON file data

func ReaderMineType

func ReaderMineType(r io.Reader) string

ReaderMineType ...

func Size

func Size(filepath string) int64

Size ...

func SizeText

func SizeText(size int64) string

SizeText ...

func Write

func Write(filepath, str string) error

Write ...

func WriteJSON

func WriteJSON(filepath string, data interface{}, pretty ...bool) error

WriteJSON write data to JSON file

Types

This section is empty.

Jump to

Keyboard shortcuts

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