Documentation ¶
Index ¶
- func DirExists(filename string) (bool, error)
- func DirExistsBestEffort(filename string) bool
- func EnsureUserOwned(dir string, owner *user.User) error
- func ExpandPath(s string) string
- func FileExists(filename string) (bool, error)
- func FileExistsBestEffort(filename string) bool
- func GetUserHomeDirs() (map[string]string, error)
- func GlobDirs(pattern string) ([]string, error)
- func HomeDir() (string, *user.User)
- func IsDirWritable(path string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirExistsBestEffort ¶
DirExistsBestEffort returns true if the directory exists and ignores errors
func EnsureUserOwned ¶
EnsureUserOwned changes the files in the directory to be owned by the use and their group, as specified by the provided user.
func FileExists ¶
FileExists returns true if the file exists
func FileExistsBestEffort ¶
FileExistsBestEffort returns true if the directory exists and ignores errors
func GetUserHomeDirs ¶
GetUserHomeDirs returns a map of all users and their homedirs
func GlobDirs ¶ added in v0.8.0
GlobDirs will return any sub-directories which match the provided glob pattern. Example: "/tmp/*" will return all sub-directories under "/tmp/".
func HomeDir ¶
HomeDir returns the home directory of the current user, together with the user object who owns it. If SUDO_USER is detected, then that user's home directory will be used instead.
func IsDirWritable ¶
IsDirWritable returns if the path is a directory that the user can write to
Types ¶
This section is empty.