Documentation ¶
Index ¶
Constants ¶
const ( TempFilePermissions = 0600 // rw for owner only TempDirPermissions = 0700 | os.ModeDir )
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile duplicates the contents of `src` and writes it to a file at `dst` with the same permissions The parent dirs of `dst` are assumed to exist. Adapted From: https://gist.github.com/r0l1/92462b38df26839a3ca324697c8cba04
func HomeDir ¶
func HomeDir() string
HomeDir returns the user's home directory
This isn't guarenteed to be non-empty as users can often change this.
func IsExecutable ¶
IsExecutable checks if a given path exists, is a file, not a symlink, and has its owner's executable bit set
func MirrorDir ¶
MirrorDir will take a `src` directory and mirror it exactly under `dst` location. If no errors occur during the mirroring `nil` is returned, otherwise an non-nil error Adapted From: https://gist.github.com/r0l1/92462b38df26839a3ca324697c8cba04 - Symlinks are copied
func SortFileInfos ¶
func SudoCopyFile ¶
SudoCopyFile attempts to copy a file (and wraps CopyFile), but if required will escalate to higher permissions in order to copy a file.
Types ¶
This section is empty.