Documentation
¶
Index ¶
- func AppendFile(filename string, data string)
- func AppendLine(path string, content string) error
- func BuildDir(absDir string) error
- func CheckFileIsExist(filename string) bool
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- func Copy(source string, dest string, fn func(path string, info os.FileInfo) bool) (err error)
- func CopyDir(source string, dest string) (err error)
- func CopyFile(source string, dest string) (err error)
- func DeleteFile(absDir string) error
- func DirName(argv ...string) string
- func FileExt(filePathName string) string
- func GetCurrentDirectory() string
- func GetExt(fileName string) string
- func GetFileSize(path string) (i int64, err error)
- func GetImageName(name string) string
- func GetModelPath() string
- func GetPathDirs(absDir string) (re []string)
- func GetPathFiles(absDir string) (re []string)
- func GetProPath() string
- func GetSize(r io.Reader) (i int, err error)
- func GrepFile(patten string, filename string) (lines []string, err error)
- func IsBinary(content string) bool
- func IsDir(path string) bool
- func IsExist(path string) bool
- func IsFile(f string) bool
- func IsImg(extension string) bool
- func IsNotExistMkDir(src string) (err error)
- func MkDir(src string) (err error)
- func MustOpen(fileName, filePath string) (f *os.File, err error)
- func Open(name string, flag int, perm os.FileMode) (f *os.File, err error)
- func PathExists(path string) (bool, error)
- func ReadFile(fname string) (src []string)
- func WriteFile(fname string, src []string, isClear bool) bool
- func WriteString(path string, content string, append bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFile ¶ added in v0.2.25
func AppendLine ¶ added in v0.2.32
func CheckFileIsExist ¶ added in v0.2.19
CheckFileIsExist 检查目录是否存在
func CheckPermission ¶
CheckPermission check if the file has permission
func GetCurrentDirectory ¶ added in v0.2.19
func GetCurrentDirectory() string
GetCurrentDirectory 获取程序运行路径
func GetFileSize ¶
GetFileSize get the length in bytes of file of the specified path.
func GetPathDirs ¶ added in v0.2.19
GetPathDirs 获取目录所有文件夹
func GetPathFiles ¶ added in v0.2.19
GetPathFiles 获取目录所有文件
func GetProPath ¶ added in v0.2.25
func GetProPath() string
func GrepFile ¶
GrepFile like command grep -E for example: GrepFile(`^hello`, "hello.txt") \n is striped while read
func IsNotExistMkDir ¶
IsNotExistMkDir create a directory if it does not exist
func PathExists ¶ added in v0.2.32
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.