Documentation ¶
Index ¶
- Constants
- Variables
- func Append(dst string, src string) error
- func AppendAll(dst string, src string) error
- func ChtimesNow(name string) error
- func Copy(dst string, src 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 Make(name string) error
- func MakeAll(name string) 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)
- type FileInfos
- type WalkFileInfo
- type WalkFileInfos
Constants ¶
const ( DefaultPermissionFile os.FileMode = 0644 DefaultPermissionDirectory os.FileMode = 0755 )
Variables ¶
Functions ¶
func Append ¶ added in v0.0.114
Append 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). parent dirs will not be created, otherwise, use AppendAll instead.
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 Copy ¶ added in v0.0.114
Copy 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). parent dirs will not be created, otherwise, use CopyAll instead.
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 is the generalized open call; most users will use Copy or Append instead. It opens the named file or directory with specified flag (O_RDONLY etc.). 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 Make ¶ added in v0.0.115
MakeAll creates a directory named path and returns nil, or else returns an error. If the dir does not exist, it is created with mode 0755 (before umask).
func MakeAll ¶ added in v0.0.115
MakeAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. If the dir does not exist, it is created with mode 0755 (before umask).
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 ¶
type WalkFileInfo ¶ added in v0.0.115
WalkFileInfo is a wrapper for sort of filepath.WalkFunc
type WalkFileInfos ¶ added in v0.0.115
type WalkFileInfos []WalkFileInfo
func (WalkFileInfos) Len ¶ added in v0.0.115
func (w WalkFileInfos) Len() int
func (WalkFileInfos) Less ¶ added in v0.0.115
func (w WalkFileInfos) Less(i, j int) bool
func (WalkFileInfos) Swap ¶ added in v0.0.115
func (w WalkFileInfos) Swap(i, j int)