// isAssetFile returns true if `path` base name matches some of
// `assetExts` glob.
777357
func isAssetFile(path string, assetExts []string) (ok bool) {
	base := filepath.Base(path)
	for _, pattern := range assetExts {
		if match, _ := filepath.Match(pattern, base); match {
			return true
		}
	}
	return false
}
262565
func IsDir(fpath string) bool {
	d := cleanPath(fpath)
	if fi, err := os.Stat(d); err == nil {
		return fi.IsDir()
	}
	return false
}
1041724
func ValidateFileAttrValue(path string) (string, error) {
	absPath, err := utils.ExpandPath(path)
	if err != nil {
		return "", err
	}
	info, err := os.Stat(absPath)
	if err != nil {
		return "", errors.Errorf("invalid file path: %s", absPath)
	}
	if info.IsDir() {
		return "", errors.Errorf("file path must be a file: %s", absPath)
	}
	return absPath, nil
}
529540
func ParseFile(path string) (*Template, error) {
	f, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	defer f.Close()
	return Parse(f, path)
}
290930
func IsDirectory(filePath string) bool {
	stat, err := os.Stat(filePath)
	if err != nil {
		return false
	}
	return stat.IsDir()
}
1214546
func IsDir(fs Fs, path string) (bool, error) {
	fi, err := fs.Stat(path)
	if err != nil {
		return false, err
	}
	return fi.IsDir(), nil
}
278911
func isParentPath(parent, path string) bool {
	rel, err := filepath.Rel(parent, path)
	return err == nil && !strings.HasPrefix(rel, "..")
}
769532
func (d *SourceFilesystem) Contains(filename string) bool {
	for _, dir := range d.Dirnames {
		if strings.HasPrefix(filename, dir) {
			return true
		}
	}
	return false
}
1170738
func IsSymlink(file string) (bool, error) {
	fileStat, err := os.Lstat(file)
	if err != nil {
		return false, err
	}

	return fileStat.Mode()&os.ModeSymlink != 0, nil
}
345244
func shouldWriteFile(path string, content []byte) (bool, error) {
	_, err := os.Lstat(path)
	if os.IsNotExist(err) {
		return true, nil
	}

	contentOnFs, err := ioutil.ReadFile(path)
	if err != nil {
		return false, err
	}

	return (bytes.Compare(content, contentOnFs) != 0), nil
}
640828
func (m FileMode) IsFile() bool {
	return m == Regular ||
		m == Deprecated ||
		m == Executable ||
		m == Symlink
}
1357435
func IsDir(path string, fs afero.Fs) (bool, error) {
	return afero.IsDir(fs, path)
}
876859
func isFile(name string) (bool, error) {
	info, err := os.Stat(name)
	return err == nil && !info.IsDir(), err
}
563793
func (d *Decoder) IsValidFile() bool {
	d.ReadInfo()
	if d.err != nil && d.err != io.EOF {
		return false
	}
	if d.NumChans < 1 {
		return false
	}
	if d.BitDepth < 8 {
		return false
	}
	if d, err := d.Duration(); err != nil || d <= 0 {
		return false
	}

	return true
}
558925
func (actor Actor) FileExists(path string) bool {
	_, err := os.Stat(path)
	return err == nil
}
1042993
func FileExist(filePath string) bool {
	_, err := os.Stat(filePath)
	if err != nil && os.IsNotExist(err) {
		return false
	}

	return true
}
1129417
func IsAbsURL(path string) bool {
	url, err := url.Parse(path)
	if err != nil {
		return false
	}

	return url.IsAbs() || strings.HasPrefix(path, "//")
}