Documentation ¶
Index ¶
- func Basename(fp string) string
- func Close(fd *os.File) error
- func Create(name string) (*os.File, error)
- func Dir(fp string) string
- func DirsUnder(dirPath string) ([]string, error)
- func EnsureDir(fp string) error
- func EnsureDirRW(dataDir string) error
- func Ext(fp string) string
- func FileMTime(fp string) (int64, error)
- func FileSize(fp string) (int64, error)
- func FilesUnder(dirPath string) ([]string, error)
- func InsureDir(fp string) error
- func IsExist(fp string) bool
- func IsFile(fp string) bool
- func MustOpenLogFile(fp string) *os.File
- func ReadLine(r *bufio.Reader) ([]byte, error)
- func RealPath(fp string) (string, error)
- func Remove(name string) error
- func Rename(src string, target string) error
- func SearchFile(filename string, paths ...string) (fullPath string, err error)
- func SelfDir() string
- func SelfPath() string
- func ToBytes(filePath string) ([]byte, error)
- func ToInt64(filePath string) (int64, error)
- func ToString(filePath string) (string, error)
- func ToTrimString(filePath string) (string, error)
- func ToUint64(filePath string) (uint64, error)
- func Unlink(fp string) error
- func WriteBytes(filePath string, b []byte) (n int, err error)
- func WriteString(filePath string, s string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDirRW ¶
ensure the datadir and make sure it's rw-able
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 MustOpenLogFile ¶
func SearchFile ¶
Search a file in paths. this is often used in search config file in /etc ~/
func ToTrimString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.