Documentation ¶
Overview ¶
Additional helpers for working with file paths and filesystem information
Index ¶
- func DirExists(path string) bool
- func Exists(path string) bool
- func ExpandUser(path string) (string, error)
- func FileExists(path string) bool
- func IsAppend(mode os.FileMode) bool
- func IsAppendable(filename string) bool
- func IsCharDevice(mode os.FileMode) bool
- func IsDevice(mode os.FileMode) bool
- func IsExclusive(mode os.FileMode) bool
- func IsNamedPipe(mode os.FileMode) bool
- func IsNonemptyDir(path string) bool
- func IsNonemptyExecutableFile(path string) bool
- func IsNonemptyFile(path string) bool
- func IsReadable(filename string) bool
- func IsSetgid(mode os.FileMode) bool
- func IsSetuid(mode os.FileMode) bool
- func IsSocket(mode os.FileMode) bool
- func IsSticky(mode os.FileMode) bool
- func IsSymlink(mode os.FileMode) bool
- func IsTemporary(mode os.FileMode) bool
- func IsWritable(filename string) bool
- func LinkExists(path string) bool
- func MatchPath(pattern string, path string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandUser ¶
ExpandUser replaces the tilde (~) in a path into the current user's home directory.
func FileExists ¶
Returns true if the given path exists and is a regular file.
func IsAppendable ¶ added in v1.6.18
Returns true if the given file can be opened for appending by the current user.
func IsCharDevice ¶
func IsExclusive ¶
func IsNamedPipe ¶
func IsNonemptyDir ¶
Returns true if the given path is a directory with items in it.
func IsNonemptyExecutableFile ¶ added in v1.6.8
Returns true if the given path is a regular file, is executable by any user, and has a non-zero size.
func IsNonemptyFile ¶
Returns true if the given path is a regular file with a non-zero size.
func IsReadable ¶
Returns true if the given file can be opened for reading by the current user.
func IsTemporary ¶
func IsWritable ¶
Returns true if the given file can be opened for writing by the current user.
func LinkExists ¶ added in v1.6.18
Returns true if the given path exists and is a symbolic link.
func MatchPath ¶ added in v1.10.12
Returns whether a given path matches a glob pattern.
via github.com/gobwas/glob:
Compile creates Glob for given pattern and strings (if any present after pattern) as separators. The pattern syntax is:
pattern: { term } term: `*` matches any sequence of non-separator characters `**` matches any sequence of characters `?` matches any single non-separator character `[` [ `!` ] { character-range } `]` character class (must be non-empty) `{` pattern-list `}` pattern alternatives c matches character c (c != `*`, `**`, `?`, `\`, `[`, `{`, `}`) `\` c matches character c character-range: c matches character c (c != `\\`, `-`, `]`) `\` c matches character c lo `-` hi matches character c for lo <= c <= hi pattern-list: pattern { `,` pattern } comma-separated (without spaces) patterns
Types ¶
This section is empty.