Documentation ¶
Overview ¶
Package filesystem provides functionality for interacting with directories and files in a cross-platform manner.
Index ¶
- Constants
- func ExistOrCreate(path string) (err error)
- func GetCanonicalPath(p string) string
- func GetFullDirectoryPath(name string) (string, error)
- func GetUserHomeDirectory() string
- func PathExists(path string) bool
- func SetupTestHooks(users map[string]*user.User)
- func TearDownTestHooks()
- func TestUsers() map[string]*user.User
Constants ¶
const OwnerReadWrite = 0600
OwnerReadWrite is a standard owner read / write file permission.
const OwnerReadWriteExec = 0700
OwnerReadWriteExec is a standard owner read / write / exec file permission.
Variables ¶
This section is empty.
Functions ¶
func ExistOrCreate ¶
ExistOrCreate creates the given path if it does not exist.
func GetCanonicalPath ¶
GetCanonicalPath returns an os-specific full path following these rules: - replace ~ with user's home dir path - expand any ${vars} or $vars - resolve relative paths /.../ p: source path name
func GetFullDirectoryPath ¶
GetFullDirectoryPath gets the OS specific full path for a named directory. The directory is created if it doesn't exist.
func GetUserHomeDirectory ¶
func GetUserHomeDirectory() string
GetUserHomeDirectory returns the current user's home directory if one is set by the system.
func PathExists ¶
PathExists returns true iff file exists in local store and is accessible.
func SetupTestHooks ¶
SetupTestHooks sets current user to mock user to test
Types ¶
This section is empty.