file

package
v0.0.0-...-3c772d0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(fp string) string

get filepath dir name

func DirsUnder

func DirsUnder(dirPath string) ([]string, error)

list dirs under dirPath

func Download

func Download(toFile, url string) error

func EnsureDir

func EnsureDir(fp string) error

mkdir dir if not exist

func IsExist

func IsExist(fp string) bool

IsExist checks whether a file or directory exists. It returns false when the file or directory does not exist.

func IsFile

func IsFile(fp string) bool

IsFile checks whether the path is a file, it returns false when it's a directory or does not exist.

func Md5File

func Md5File(file string) (string, error)

func Md5String

func Md5String(str string) string

func ReadBytes

func ReadBytes(cpath string) ([]byte, error)

func ReadString

func ReadString(cpath string) (string, error)

func RealPath

func RealPath(fp string) (string, error)

get absolute filepath, based on built executable file

func SelfDir

func SelfDir() string

SelfDir gets compiled executable file directory

func SelfPath

func SelfPath() string

SelfPath gets compiled executable file absolute path

func Unlink(fp string) error

Unlink delete file

func WriteBytes

func WriteBytes(filePath string, b []byte) (int, error)

func WriteString

func WriteString(filePath string, s string) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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