Documentation ¶
Index ¶
- func BytesToFile(path string, data []byte) error
- func ClearFile(path string) error
- func Create(path string) (*os.File, error)
- func CreateFile(filePath string) error
- func FileMD5(path string) (string, error)
- func FileMD5Reader(r io.Reader) (string, error)
- func FileSize(path string) (int64, error)
- func FileSizeFile(file *os.File) (int64, error)
- func FileToBytes(path string) []byte
- func IsDir(path string) bool
- func IsDirE(path string) (bool, error)
- func IsExist(path string) (bool, error)
- func IsFile(path string) bool
- func IsFileE(path string) (bool, error)
- func IsShortcut(path string) bool
- func IsSymlink(path string) bool
- func IsSymlinkE(path string) (bool, error)
- func ListDir(dir string) ([]string, error)
- func ListDirEntryPaths(dirname string, cur bool) ([]string, error)
- func ListDirEntryPathsSymlink(dirname string, cur bool) ([]string, error)
- func ListFileNames(dir string) ([]string, error)
- func ReadLines(path string) ([]string, int, error)
- func RemoveFile(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToFile ¶
BytesToFile writes data to a file. If the file does not exist it will be created with permission mode 0644.
func Create ¶
Create creates or truncates the target file specified by path. If the parent directory does not exist, it will be created with mode os.ModePerm. If the file does not exist, it is created with mode 0666. If successful, methods on the returned file can be used for I/O; the associated file descriptor has mode O_RDWR.
func CreateFile ¶
CreateFile creates a file specified by path.
func FileMD5Reader ¶
FileMD5Reader gets file MD5 from io.Reader.
func FileSizeFile ¶
FileSizeFile gets file size from os.File in bytes.
func IsShortcut ¶
IsShortcut checks a file whether is a shortcut on Windows.
func IsSymlinkE ¶
func ListDirEntryPaths ¶
ListDirEntryPaths lists all the file or directory paths in the directory recursively. If the cur is true result will include current directory. Note that GetDirAllEntryPaths won't follow symlink if the subdir is a symbolic link.
func ListDirEntryPathsSymlink ¶
ListDirEntryPathsSymlink lists all the file or dir paths in the directory recursively. If the cur is true result will include current directory.
func ListFileNames ¶
ListFileNames lists all file names in the directory.
func RemoveFile ¶
RemoveFile removes the named file or empty directory. If there is an error, it will be of type *PathError.
Types ¶
This section is empty.