Documentation ¶
Index ¶
- func Abs(p string) string
- func BaseName(file string) string
- func Bytes(file string) (d []byte)
- func Copy(srcFile, dstFile string, mkdir bool) error
- func Exists(path string) bool
- func FileMTime(file string) (time.Time, error)
- func FileName(file string) string
- func FileSize(file string) (int64, error)
- func HomeDir() string
- func IsDir(file string) bool
- func IsEmptyDir(path string) bool
- func IsFile(file string) bool
- func IsLink(path string) bool
- func ReadAll(file string) string
- func ResolveLink(path string) (string, error)
- func Write(file string, data []byte, append bool) (err error)
- func WriteString(file string, data string, append bool) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
Abs is similar to Abs in the std library "path/filepath", but firstly convert "~"" and "$HOME" to the home directory.
Return the origin path if there is an error.
func Copy ¶
Copy source path file to destination file path, when mkdir is true and destination path not exists, the destination dir will be created
func Exists ¶
Exists checks whether a file or directory exists. It returns false when the file or directory does not exists.
func HomeDir ¶
func HomeDir() string
HomeDir returns the home directory.
Return "" if the home directory is empty.
func IsDir ¶
IsDir checks whether the path is a directory, it returns false when it's not a directory or does not exists.
func IsEmptyDir ¶
IsEmptyDir returns true if the directory contains nothing, otherwise returns false
func IsFile ¶
IsFile checks whether the path is a file, it returns false when it's a directory or does not exists.
func ResolveLink ¶
ResolveLink resolves the link if it is a Link or return the original path
Types ¶
This section is empty.