pathutil

package
v1.8.55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 5 Imported by: 22

Documentation

Overview

Additional helpers for working with file paths and filesystem information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(path string) bool

Returns true if the given path exists and is a directory.

func Exists added in v1.6.18

func Exists(path string) bool

Returns true if the given path exists.

func ExpandUser

func ExpandUser(path string) (string, error)

ExpandUser replaces the tilde (~) in a path into the current user's home directory.

func FileExists

func FileExists(path string) bool

Returns true if the given path exists and is a regular file.

func IsAppend

func IsAppend(mode os.FileMode) bool

func IsAppendable added in v1.6.18

func IsAppendable(filename string) bool

Returns true if the given file can be opened for appending by the current user.

func IsCharDevice

func IsCharDevice(mode os.FileMode) bool

func IsDevice

func IsDevice(mode os.FileMode) bool

func IsExclusive

func IsExclusive(mode os.FileMode) bool

func IsNamedPipe

func IsNamedPipe(mode os.FileMode) bool

func IsNonemptyDir

func IsNonemptyDir(path string) bool

Returns true if the given path is a directory with items in it.

func IsNonemptyExecutableFile added in v1.6.8

func IsNonemptyExecutableFile(path string) bool

Returns true if the given path is a regular file, is executable by any user, and has a non-zero size.

func IsNonemptyFile

func IsNonemptyFile(path string) bool

Returns true if the given path is a regular file with a non-zero size.

func IsReadable

func IsReadable(filename string) bool

Returns true if the given file can be opened for reading by the current user.

func IsSetgid

func IsSetgid(mode os.FileMode) bool

func IsSetuid

func IsSetuid(mode os.FileMode) bool

func IsSocket

func IsSocket(mode os.FileMode) bool

func IsSticky

func IsSticky(mode os.FileMode) bool
func IsSymlink(mode os.FileMode) bool

func IsTemporary

func IsTemporary(mode os.FileMode) bool

func IsWritable

func IsWritable(filename string) bool

Returns true if the given file can be opened for writing by the current user.

func LinkExists added in v1.6.18

func LinkExists(path string) bool

Returns true if the given path exists and is a symbolic link.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL