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 Getenv(key string, def ...string) string
- func InlineTilde(path string) string
- func Open(path string) (*os.File, error)
- func OpenFile(name string, flag int, perm os.FileMode) (*os.File, 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 ¶ added in v0.5.2
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 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 ¶ added in v0.5.4
InlineTilde replaces the leading ~ with the home directory.
func OpenFile ¶ added in v0.5.2
OpenFile is similar to os.OpenFile but supports ~ as the home directory, and also supports the parent directory creation.
func UserHomeDir ¶ added in v0.6.2
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
}