xfile

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) error

Copy ...

func GetConfigDir added in v0.0.5

func GetConfigDir(paths ...string) (string, error)

GetConfigDir ...

func GetCurrentDir

func GetCurrentDir() string

GetCurrentDir ...

func GetFileDir

func GetFileDir(filepath string) string

GetFileDir ...

func GetFileExt

func GetFileExt(file string) string

GetFileExt ...

func GetFileName

func GetFileName(filepath string) string

GetFileName ...

func GetFileNameWithoutExt

func GetFileNameWithoutExt(filepath string) string

GetFileNameWithoutExt ...

func GetFilePathWithoutExt

func GetFilePathWithoutExt(filepath string) string

GetFilePathWithoutExt ...

func GetHomeDir

func GetHomeDir() string

GetHomeDir ...

func IsDir

func IsDir(filepath string) bool

IsDir ...

func IsExist

func IsExist(filepath string) bool

IsExist ...

func IsFile

func IsFile(filepath string) bool

IsFile ...

func IsImage

func IsImage(filepath string) bool

IsImage ...

func LineContent

func LineContent(filepath string, numbers ...int) map[int]string

LineContent ...

func LineCount

func LineCount(filepath string) int

LineCount ...

func ListDirs added in v0.0.5

func ListDirs(dir string, isRecursive ...bool) []string

ListDirs ...

func ListFiles

func ListFiles(dir string, match string, isRecursive ...bool) []string

ListFiles ...

func Md5 added in v0.0.2

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 Shadow added in v0.0.6

func Shadow(filepath string) string

Shadow 根据当前文件名称取其影分身 /tmp/abc.txt => /tmp/abc_1.txt

func Size

func Size(filepath string) int64

Size ...

func SizeText

func SizeText(size int64) string

SizeText ...

func Temp added in v0.0.6

func Temp(filenames ...string) string

Temp ...

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