Documentation
¶
Index ¶
- func AppendFile(filename string, data string)
- func AppendLine(path string, content string) error
- func AppendTo(fileName, content string) error
- func BuildDir(absDir string) error
- func CheckFileIsExist(filename string) bool
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- 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 Empty(fileName string, args ...int64)
- func Exist(fileName string) bool
- func FileExt(filePathName string) string
- func GetExt(fileName string) string
- func GetFileSize(path string) (i int64, err error)
- func GetImageName(name string) string
- func GetProPath() string
- func GetSize(r io.Reader) (i int, err error)
- func GrepFile(patten string, filename string) (lines []string, err error)
- func IoSha(fileIO *os.File, args ...string) (string, error)
- func Is(filePath string) bool
- 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 MTime(file string) (int64, error)
- func MkDir(src string) (err error)
- func Mode(filePath string) os.FileMode
- 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 ReadFile(path string) (string, error)
- func ReadLine(path string) (src []string)
- func Save(filename string, r io.Reader) (err error)
- func Search(fileName string, paths ...string) (fullpath string, err error)
- func Sha(filePath string, args ...string) (sha string, err error)
- func Size(file string) (int64, error)
- func Write(fileName, writeStr string)
- func WriteFile(fileName string, data []byte) error
- func WriteString(path string, content string, append bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFile ¶
func AppendLine ¶
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 GetFileSize ¶
GetFileSize get the length in bytes of file of the specified path.
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 Write ¶
func Write(fileName, writeStr string)
Write writes data to a file named by filename. If the file does not exist, WriteFile creates it and its upper level paths.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.