func IsDotfile(path string) bool {
	if path == "" {
		return false
	}
	if !strings.Contains(path, "/") {
		return path[0:1] == "."
	}
	pathBase := Base(path)
	return pathBase[0:1] == "."
}
IsDotfile returns true if file name begins with a full stop
package path
import (
	"errors"
	"os"
	PATH "path"
	"path/filepath"
	"strings"
)
var ErrBadPattern = errors.New("Syntax error in pattern")
var unsafePaths = []string{
	"/lost+found",
	"/bin",
	"/boot",
	"/etc",
	"/dev",
	"/lib",
	"/lib64",
	"/proc",
	"/root",
	"/sbin",
	"/selinux",
	"/sys",
	"/usr/bin",
	"/usr/lib",
	"/usr/lib64",
	"/usr/libexec",
	"/usr/sbin",
	"/usr/include",
	"/var/cache",
	"/var/db",
	"/var/lib",
}
func Base(path string) string {
	return PATH.Base(path)
}
func Clean(path string) string {
	path = evalHome(path)
	return PATH.Clean(path)
}
func Dir(path string) string {
	return PATH.Dir(path)
}
func DirN(path string, n int) string {
	if len(path) <= 1 || n < 1 {
		return path
	}
	if path[0] == '/' {
		n++
	}
	var k int
	for i, r := range path {
		if r == '/' {
			k++
		}
		if k == n {
			return path[:i]
		}
	}
	return path
}
func Ext(path string) string {
	return PATH.Ext(path)
}
func IsAbs(path string) bool {
	return PATH.IsAbs(path)
}
func Join(elem ...string) string {
	return PATH.Join(elem...)
}
func Match(pattern, name string) (matched bool, err error) {
	return PATH.Match(pattern, name)
}
func Split(path string) (dir, file string) {
	return PATH.Split(path)
}
func IsSafe(path string) bool {
	if path == "" {
		return false
	}
	absPath, err := filepath.Abs(Clean(path))
	if err != nil || absPath == "/" {
		return false
	}
	for _, up := range unsafePaths {
		if contains(absPath, up) {
			return false
		}
	}
	return true
}