Documentation ¶
Index ¶
- func Exists(path string, followLinks bool) (bool, error)
- func IsLink(path string) (bool, error)
- func IsRegularFile(path string) (bool, error)
- func SameContents(pathA, pathB string) (bool, error)
- func SameFile(pathA, pathB string) (bool, error)
- func SameFilesystem(pathA, pathB string) (bool, error)
- type FileStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exists ¶
Exists returns true if path is an existing file or directory, otherwise it returns false. If followLinks is true, then Exists will attempt to follow links to their target and report said target's existence. If followLinks is false, Exist will operate on the link itself.
func IsRegularFile ¶
IsRegularFile returns true if path represents a regular file, otherwise it returns false.
func SameContents ¶
SameContents checks that two files contain the same bytes
func SameFilesystem ¶
SameFilesystem returns true if two files live on the same filesystem; it returns false otherwise. Follows links.
Types ¶
type FileStatus ¶
type FileStatus int
FileStatus enumerates the states of a file on the filesystem.
const ( // StatusAbsent means that the file does not exist. StatusAbsent FileStatus = iota // StatusRegularFile means that the file exists as a regular file. StatusRegularFile // StatusLink means that the artifact exists as a link. StatusLink // StatusDirectory means that the file exists as a directory. StatusDirectory // StatusOther means none of the above. StatusOther )
func FileStatusFromPath ¶
func FileStatusFromPath(path string) (FileStatus, error)
FileStatusFromPath converts a path into a FileStatus enum value.
func (FileStatus) String ¶
func (fs FileStatus) String() string