Documentation ¶
Index ¶
- func Basename(file string) string
- func Dir(file string) string
- func DirsUnder(dirPath string) ([]string, error)
- func Ext(file string) string
- func FileMTime(file string) (int64, error)
- func FileSize(file string) (int64, error)
- func FileToInt64(file string) (int64, error)
- func FileToUint64(file string) (uint64, error)
- func FilesUnder(dirPath string) ([]string, error)
- func InsureDir(path string) error
- func IsExist(path string) bool
- func IsFile(filePath string) bool
- func ReadFileToBytes(filePath string) ([]byte, error)
- func ReadFileToString(filePath string) (string, error)
- func ReadFileToStringNoLn(filePath string) (string, error)
- func RealPath(file string) (string, error)
- func Rename(file string, to string) error
- func SearchFile(filename string, paths ...string) (fullPath string, err error)
- func SelfDir() string
- func SelfPath() string
- func Unlink(file string) error
- func WriteBytesToFile(filePath string, b []byte) (int, error)
- func WriteStringToFile(filePath string, s string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileToInt64 ¶
func FileToUint64 ¶
func IsExist ¶
IsExist checks whether a file or directory exists. It returns false when the file or directory does not exist.
func IsFile ¶
IsFile checks whether the path is a file, it returns false when it's a directory or does not exist.
func ReadFileToBytes ¶
ReadFileToBytes reads data type '[]byte' from file by given path. It returns error when fail to finish operation.
func ReadFileToString ¶
ReadFileToString reads data type 'string' from file by given path. It returns error when fail to finish operation.
func ReadFileToStringNoLn ¶
func SearchFile ¶
Search a file in paths. this is often used in search config file in /etc ~/
func WriteBytesToFile ¶
WriteBytesToFile saves content type '[]byte' to file by given path. It returns error when fail to finish operation.
Types ¶
This section is empty.