Documentation ¶
Index ¶
- func BuildDir(absDir string) error
- func CheckFileIsExist(filename string) bool
- func CheckPermission(src string) bool
- func Copy(src, dst string) 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 Exist(fileName string) bool
- func GetCurrentDirectory() string
- func GetModelPath() string
- func GetPathDirs(absDir string) (re []string)
- func GetPathFiles(absDir string) (re []string)
- func GetProPath() string
- func GrepFile(patten string, filename string) (lines []string, err error)
- func IsDir(path string) bool
- func IsExist(path string) bool
- func IsNotExist(src string) bool
- func IsNotExistMkDir(src string) (err error)
- func List(dirPth, suffix string) (files []string, err error)
- func ListDir(dirPth, suffix string) (files []string, err error)
- func MkDir(src string) (err error)
- func PathExists(path string) (bool, error)
- func Realpath(fpath string) (string, error)
- func Search(fileName string, paths ...string) (fullpath string, err error)
- func TempFile(dir, prefix string, suffix string) (f *os.File, err error)
- func Walk(dirPth, suffix string) (files []string, err error)
- func WalkDir(dirPth, suffix string) (files []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPermission ¶
CheckPermission check if the file has permission
func Exist ¶
Exist checks whether a file or directory exists. It returns false when the file or directory does not exist.
func GetProPath ¶
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 TempFile ¶
TempFile creates a new temporary file in the directory dir with a name beginning with prefix and ending with suffix, opens the file for reading and writing, and returns the resulting *os.File. If dir is the empty string, TempFile uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempFile simultaneously will not choose the same file. The caller can use f.Name() to find the pathname of the file. It is the caller's responsibility to remove the file when no longer needed.
Types ¶
This section is empty.