shared/util_linux.go
func GetPathMode(path string) (os.FileMode, error) {
	s, err := os.Open(path)
	if err != nil {
		return os.FileMode(0000), err
	}
	defer s.Close()

	fi, err := s.Stat()
	if err != nil {
		return os.FileMode(0000), err
	}

	mode, _, _ := GetOwnerMode(fi)
	return mode, nil
}
func GetPathMode(path string) (os.FileMode, error) {
	s, err := os.Open(path)
	if err != nil {
		return os.FileMode(0000), err
	}
	defer s.Close()

	fi, err := s.Stat()
	if err != nil {
		return os.FileMode(0000), err
	}

	mode, _, _ := GetOwnerMode(fi)
	return mode, nil
}
// FileCopy copies a file, overwriting the target if it exists.