Documentation ¶
Index ¶
- Variables
- func Close(c io.Closer)
- func CreateFile(name string, perm os.FileMode) (*os.File, error)
- func ExistEnv(key string) bool
- func Exists(path string, checks ...func(os.FileInfo) bool) bool
- func ExistsDevice(path string) bool
- func ExistsDir(path string) bool
- func ExistsFile(path string) bool
- func ExistsLink(path string) bool
- func ExistsSocket(path string) bool
- func ExpandEnv(key string, def ...string) string
- func ForceSymlink(oldname, newname string) error
- func Getenv(key string, def ...string) string
- func InlineTilde(path string) string
- func Open(path string) (*os.File, error)
- func OpenBrowser(url string) error
- func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func Symlink(oldname, newname string) error
- func UserHomeDir() string
- func WriteFile(name string, data []byte, perm os.FileMode) error
- type MmapFile
Constants ¶
This section is empty.
Variables ¶
var ErrPageFault = errors.New("page fault occurred while reading from memory map")
Functions ¶
func CreateFile ¶
CreateFile is similar to os.Create but supports ~ as the home directory, and also supports the parent directory creation.
func ExistsDevice ¶
ExistsDevice checks if the given path exists and is a device.
func ExistsFile ¶
ExistsFile checks if the given path exists and is a regular file.
func ExistsLink ¶
ExistsLink checks if the given path exists and is a symbolic link.
func ExistsSocket ¶
ExistsSocket checks if the given path exists and is a socket.
func ForceSymlink ¶
func Getenv ¶
Getenv retrieves the value of the environment variable named by the key. It returns the default, which will be empty if the variable is not present. To distinguish between an empty value and an unset value, use LookupEnv.
func InlineTilde ¶
InlineTilde replaces the leading ~ with the home directory.
func OpenBrowser ¶
OpenBrowser opens the default web browser to the specified URL.
func OpenFile ¶
OpenFile is similar to os.OpenFile but supports ~ as the home directory, and also supports the parent directory creation.
func Symlink ¶
Symlink is similar to os.Symlink but supports ~ as the home directory, and also supports the parent directory creation.
func UserHomeDir ¶
func UserHomeDir() string
UserHomeDir is similar to os.UserHomeDir, but returns the temp dir if the home dir is not found.
Types ¶
type MmapFile ¶
type MmapFile struct {
// contains filtered or unexported fields
}