ut/utio/dir.go

23 lines
442 B
Go

package utio
import (
"os"
)
// Home gives back the home directory for the current user.
func Home() (string, error) {
return os.UserHomeDir()
}
// PathExists tests if the supplied path exists.
func PathExists(path string) bool {
var _, err = os.Stat(path)
return err == nil
}
// PathDoesNotExist tests if the supplied does not exist.
func PathDoesNotExist(path string) bool {
var _, err = os.Stat(path)
return os.IsNotExist(err)
}