Documentation ¶
Index ¶
- func CanonicalPath(path string) (string, error)
- func Cleanup(path string)
- func Exists(path string) (bool, error)
- func ForceSymlink(oldname, newname string) error
- func IsBelow(path string, root string) (bool, error)
- func IsDir(path string) bool
- func IsSymlink(path string) bool
- func PrettifyPath(path string) string
- func Touch(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalPath ¶ added in v0.1.3
CanonicalPath converts path to an absolute path and follows all symlinks (if any). If path doesn't exist, no parent symlinks are followed.
func Cleanup ¶
func Cleanup(path string)
Cleanup removes the specified file or directory and prints any errors to stderr. It's supposed to be used in defer statements to clean up temporary directories.
func ForceSymlink ¶ added in v0.7.0
ForceSymlink creates newname as a symbolic link to oldname. If newname already exists, it will be overwritten.
func IsBelow ¶
IsBelow returns true if and only if path lies below or is the path root. path and root must be either both absolute or both relative.
func IsDir ¶
IsDir returns whether this path is a directory. Tries to behave the same as Python's pathlib.Path.is_dir()
func PrettifyPath ¶
PrettifyPath prints a possibly shortened path for display purposes. If path is located under the current working directory, the relative path to it is returned, otherwise or in case of an error the path is returned unchanged.
Types ¶
This section is empty.