fileutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(source, des string) error

Copy copy file content https://www.jb51.net/article/148552.htm

func DelDir

func DelDir(path string) error

DelDir delete dir

func FileEmpty

func FileEmpty(path string) (bool, error)

FileEmpty Is the file content empty true: file content is empty false: file content is not empty

func FileMd5Equal

func FileMd5Equal(srcFile, desFile string) (bool, error)

FileMd5Equal Determine whether the contents of the two files are equal

func GetBase

func GetBase() string

GetBase get root path

func GetFileName

func GetFileName(path string) string

GetFileName Get the file name under the specified path

func Join

func Join(path, fileName string) string

Join join path and file name

func Md5Sum

func Md5Sum(filePath string) (string, error)

Md5Sum file md5

func MkFile

func MkFile(path string) error

MkFile create file

func MkdirAll

func MkdirAll(path string) error

MkdirAll make all dir, if parent dir is not exist,mkdir parent dir. like: cmd mkdir -p

func PathStatus

func PathStatus(path string) (exist, dir bool)

PathStatus path is exist and path is dir exist: true exist; false not exist dir: true is dir; false not

func SubDirs

func SubDirs(path string) (map[string]bool, error)

SubDirs get all file names under the specified path map

func SubFiles

func SubFiles(path string) ([]string, error)

SubFiles get all file name under the specified path slice

func Touch

func Touch(configPath string) error

Touch create file. if parent dir is not exist. mkdir parent dir. like cmd: touch

Types

This section is empty.

Jump to

Keyboard shortcuts

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