Documentation
¶
Index ¶
- Constants
- Variables
- func AppendAll(dst string, src string) error
- func ChtimesNow(name string) error
- func CopyAll(dst string, src string) error
- func CopyFile(dst string, src string, flag int, perm os.FileMode) error
- func CopyFileAll(dst string, src string, flag int, dirperm, fileperm os.FileMode) error
- func CreateAll(path string) (*os.File, error)
- func CreateAllIfNotExist(path string) (*os.File, error)
- func GetAbsBinDir() (dir string, err error)
- func OpenAll(path string) (*os.File, error)
- func OpenFileAll(path string, flag int, dirperm, fileperm os.FileMode) (*os.File, error)
- func PathExists(path string) (bool, error)
- func SameFile(fi1, fi2 string) bool
- func TouchAll(path string) (*os.File, error)
Constants ¶
const ( DefaultPermissionFile os.FileMode = 0644 DefaultPermissionDirectory os.FileMode = 0755 )
Variables ¶
Functions ¶
func AppendAll ¶ added in v0.0.113
AppendAll creates or appends the dst file or dir, filled with content from src file. If the dst file already exists, it is truncated. If the dst file does not exist, it is created with mode 0666 (before umask). If the dst dir does not exist, it is created with mode 0755 (before umask).
func ChtimesNow ¶ added in v0.0.23
Chtimes changes the access and modification times of the named file with Now, similar to the Unix utime() or utimes() functions.
The underlying filesystem may truncate or round the values to a less precise time unit. If there is an error, it will be of type *PathError.
func CopyAll ¶ added in v0.0.113
CopyAll creates or truncates the dst file or dir, filled with content from src file. If the dst file already exists, it is truncated. If the dst file does not exist, it is created with mode 0666 (before umask). If the dst dir does not exist, it is created with mode 0755 (before umask).
func CopyFile ¶ added in v0.0.104
CopyFile copies from src to dst. parent dirs will not be created, otherwise, use CopyFileAll instead.
func CopyFileAll ¶ added in v0.0.113
CopyFileAll is the generalized open call; most users will use CopyAll or AppendAll instead. It opens the named file or directory with specified flag (O_RDONLY etc.). If the dst file does not exist, and the O_CREATE flag is passed, it is created with mode fileperm (before umask). If the dst directory does not exist,, it is created with mode dirperm (before umask). If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError.
func CreateAll ¶ added in v0.0.23
CreateAll creates or truncates the named file or dir. If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If the dir does not exist, it is created with mode 0755 (before umask).
func CreateAllIfNotExist ¶ added in v0.0.23
CreateAllIfNotExist creates the named file or dir. If the file does not exist, it is created with mode 0666 (before umask). If the dir does not exist, it is created with mode 0755 (before umask). If path is already a directory, CreateAllIfNotExist does nothing and returns nil.
func GetAbsBinDir ¶
func OpenAll ¶ added in v0.0.113
OpenAll opens the named file or dir for reading. If successful, methods on the returned file or dir can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
func OpenFileAll ¶ added in v0.0.113
OpenFileAll is the generalized open call; most users will use OpenAll or CreateAll instead. It opens the named file or directory with specified flag (O_RDONLY etc.). If the file does not exist, and the O_CREATE flag is passed, it is created with mode fileperm (before umask). If the directory does not exist,, it is created with mode dirperm (before umask). If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError.
func PathExists ¶
func SameFile ¶ added in v0.0.104
SameFile reports whether fi1 and fi2 describe the same file. Overload os.SameFile by file path
Types ¶
This section is empty.