// Returns true if and only if the given path refers to a file or a symlink
// to a file.
175812
func pathIsFile(path string) bool {
	info, err := os.Stat(path)
	if err != nil {
		return false
	}

	return !info.IsDir()
}
819229
func (e *etc) HasPath(path string) bool {
	fullPath := makeFullPath(path)
	changer := e.values.At(fullPath...)
	return changer.Error() == nil
}
942473
func isWindowsExecutable(path string) bool {
	return execExts[strings.ToLower(filepath.Ext(path))]
}
861394
func resolveSymbolicLink(path, scope string) (string, error) {
	info, err := os.Lstat(path)
	if err != nil {
		return "", err
	}
	if info.Mode()&os.ModeSymlink != os.ModeSymlink {
		return path, nil
	}
	if scope == "" {
		scope = "/"
	}
	return symlink.FollowSymlinkInScope(path, scope)
}
1131078
func Path(baseDir string, name string) string {
	key := repoKeyStr(name)
	return filepath.Join(baseDir, key)
}
667867
func isSymlinkTargetDir(f os.FileInfo, urlPath string, config *Config) bool {
	if !isSymlink(f) {
		return false
	}

	// a bit strange, but we want Stat thru the jailed filesystem to be safe
	target, err := config.Fs.Root.Open(path.Join(urlPath, f.Name()))
	if err != nil {
		return false
	}
	defer target.Close()
	targetInfo, err := target.Stat()
	if err != nil {
		return false
	}

	return targetInfo.IsDir()
}
1235347
func (t *TermsLookup) Path(path string) *TermsLookup {
	t.path = path
	return t
}
1233433
func (n *Mounter) ExistsPath(pathname string) (bool, error) {
	// Resolve the symlinks but allow the target not to exist. EvalSymlinks
	// would return an generic error when the target does not exist.
	hostPath, err := n.ne.EvalSymlinks(pathname, false /* mustExist */)
	if err != nil {
		return false, err
	}
	kubeletpath := n.ne.KubeletPath(hostPath)
	return utilpath.Exists(utilpath.CheckFollowSymlink, kubeletpath)
}
6035
func IsDirExists(path string) bool {
	fi, err := os.Stat(path)

	if err != nil {
		return os.IsExist(err)
	} else {
		return fi.IsDir()
	}

	panic("util isDirExists not reached")
}
1070576
func ResolveSymlinks(path string) string {
	if len(path) == 0 {
		return path
	}

	if resolved, err := filepath.EvalSymlinks(path); err == nil {
		return resolved
	}
	return path
}
1264363
func (d *Dir) Symlink(ctx context.Context, req *fuse.SymlinkRequest) (
	node fs.Node, err error) {
	ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Symlink",
		fmt.Sprintf("%s %s -> %s", d.node.GetBasename(),
			req.NewName, req.Target))
	defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()

	d.folder.fs.vlog.CLogf(
		ctx, libkb.VLog1, "Dir Symlink %s -> %s", req.NewName, req.Target)
	defer func() { err = d.folder.processError(ctx, libkbfs.WriteMode, err) }()

	// This fits in situation 1 as described in libkbfs/delayed_cancellation.go
	err = libcontext.EnableDelayedCancellationWithGracePeriod(
		ctx, d.folder.fs.config.DelayedCancellationGracePeriod())
	if err != nil {
		return nil, err
	}

	if _, err := d.folder.fs.config.KBFSOps().CreateLink(
		ctx, d.node, req.NewName, req.Target); err != nil {
		return nil, err
	}

	child := &Symlink{
		parent: d,
		name:   req.NewName,
		inode:  d.folder.fs.assignInode(),
	}
	return child, nil
}
889654
func (fs *FS) Symlink(target, link string) (err error) {
	fs.log.CDebugf(fs.ctx, "Symlink target=%s link=%s", target, link)
	defer func() {
		fs.deferLog.CDebugf(fs.ctx, "Symlink done: %+v", err)
		err = translateErr(err)
	}()

	if err := fs.requireNonEmpty(); err != nil {
		return err
	}

	err = fs.ensureParentDir(link)
	if err != nil {
		return err
	}

	n, _, base, err := fs.lookupParent(link)
	if err != nil {
		return err
	}

	_, err = fs.config.KBFSOps().CreateLink(fs.ctx, n, base, target)
	return err
}
262565
func IsDir(fpath string) bool {
	d := cleanPath(fpath)
	if fi, err := os.Stat(d); err == nil {
		return fi.IsDir()
	}
	return false
}
1115861
func IsDir(path string) bool {
	finfo, err := os.Stat(path)
	switch {
	case err != nil:
		return false
	case finfo.IsDir():
		return true
	default:
		return false
	}
}
1350206
func (p *Path) HasFilter(via interface{}, rev bool, filt ...shape.ValueFilter) *Path {
	np := p.clone()
	np.stack = append(np.stack, hasFilterMorphism(via, rev, filt))
	return np
}
834590
func IsFile(path string) bool {
	src, err := os.Stat(path)
	if os.IsNotExist(err) {
		return false
	}
	return !src.IsDir()
}
694217
func Path(path string) option {
	return func(c *sass) error {
		c.srcFile = path
		c.ctx.MainFile = path
		return nil
	}
}