Documentation ¶
Overview ¶
Package parlos provides simplified functions related to the os package
Package parlos provides simplified functions related to the os package ¶
Package parlos provides simplified functions related to the os package
Index ¶
- Constants
- func AppDir(appName string) (directory string)
- func ExecDir() (dir string)
- func Exit(code int, err error)
- func Exit0()
- func Exit1(err error)
- func Exit1OneLine(err error)
- func HomeDir(relPaths string) (dir string)
- func OsExit(code int)
- func ParentDir() (dir string)
- func ShortHostname() (host string)
- func UserHomeDir() (homeDir string)
- type AppDirectory
Constants ¶
const ( StatusCodeErr = 1 StatusCodeUsage = 2 )
Variables ¶
This section is empty.
Functions ¶
func ExecDir ¶ added in v0.4.24
func ExecDir() (dir string)
ExecDir gets abolute path to directory where executable is located
func Exit1 ¶
func Exit1(err error)
Exit1 terminate the command echoing a failure to stderr and returning status code 1
func Exit1OneLine ¶
func Exit1OneLine(err error)
Exit1OneLine terminate the command echoing to stderr returning status code 1
func HomeDir ¶
HomeDir creates levels of directories in users’s home. if directories do not exist, they are created with permissions u=rwx. This should never fail, when it does, panic is thrown
func ParentDir ¶ added in v0.4.24
func ParentDir() (dir string)
ParentDir gets absolute path of executable parent directory
func ShortHostname ¶
func ShortHostname() (host string)
ShortHostname gets hostname without domain part This should never fail, when it does, panic is thrown
func UserHomeDir ¶
func UserHomeDir() (homeDir string)
UserHomeDir obtains the absolute path to the process owning user’s home directory. This should never fail, when it does, panic is thrown
Types ¶
type AppDirectory ¶ added in v0.4.24
type AppDirectory struct {
App string
}
func NewAppDir ¶ added in v0.4.24
func NewAppDir(appName string) (appd *AppDirectory)
NewAppDir returns an object providing an app-specific file system location with defered directory creation
func (*AppDirectory) Directory ¶ added in v0.4.24
func (appd *AppDirectory) Directory() (directory string)