Documentation ¶
Index ¶
- func Copy(src string, dst string) (err error)
- func Copy2(src string, dst string) (err error)
- func CopyMeta(src string, dst string) (err error)
- func CopyOwnership(src string, dst string) (err error)
- func Exists(path string) bool
- func ExistsAndDir(path string) (bool, error)
- func ExistsAndRegular(path string) (bool, error)
- func ExistsAndSymlink(path string) (bool, error)
- func ExistsNotDir(path string) (bool, error)
- func HaveSameMD5(opts ...interface{}) bool
- func IsBlockDevice(p string) (bool, error)
- func IsCharDevice(p string) (bool, error)
- func IsDevice(p string) (bool, error)
- func IsMode(p string, mode os.FileMode) (bool, error)
- func IsNotDir(err error) bool
- func IsPerm(p string, perm os.FileMode) (bool, error)
- func IsProtected(fpath string) bool
- func MD5(p string) ([]byte, error)
- func MD5Reader(r io.Reader) ([]byte, error)
- func ModTime(p string) (mtime time.Time)
- func Mode(p string) (os.FileMode, error)
- func Ownership(p string) (uid, gid int, err error)
- func Touch(p string, tm time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy copies the file content from src file path to dst file path. If dst does not exist, it is created.
func Copy2 ¶
Copy2 is Identical to Copy() except that Copy2() also attempts to preserve file metadata.
func CopyOwnership ¶
func ExistsAndDir ¶
ExistsAndDir returns true if the file path exists and is a directory.
func ExistsAndRegular ¶
ExistsAndRegular returns true if the file path exists and is a regular file.
func ExistsAndSymlink ¶
ExistsAndSymlink returns true if the file path exists and is a symbolic link.
func ExistsNotDir ¶
ExistsNotDir returns true if the file path exists and is not a directory.
func HaveSameMD5 ¶
func HaveSameMD5(opts ...interface{}) bool
HaveSameMD5 accepts a variadic list of options. Each option can be either a []byte format md5 or a file path. In the latter case, the md5 is computed inline to compare with the previous known md5.
HaveSameMD5 returns true if all options refer directly or indirectly to the same md5 checksum.
func IsBlockDevice ¶
func IsCharDevice ¶
func IsProtected ¶
IsProtected returns true if the file is too critical to alter or remove
Types ¶
This section is empty.