// isObjectDir returns true if the specified bucket & prefix exists
// and the prefix represents an empty directory. An S3 empty directory
// is also an empty directory in the FS backend.
494395
func (fs *FSObjects) isObjectDir(bucket, prefix string) bool {
	entries, err := readDirN(pathJoin(fs.fsPath, bucket, prefix), 1)
	if err != nil {
		return false
	}
	return len(entries) == 0
}
467684
func (fs *FSObjects) parentDirIsObject(ctx context.Context, bucket, parent string) bool {
	var isParentDirObject func(string) bool
	isParentDirObject = func(p string) bool {
		if p == "." || p == "/" {
			return false
		}
		if fsIsFile(ctx, pathJoin(fs.fsPath, bucket, p)) {
			// If there is already a file at prefix "p", return true.
			return true
		}

		// Check if there is a file as one of the parent paths.
		return isParentDirObject(path.Dir(p))
	}
	return isParentDirObject(parent)
}
1057877
func Empty(dirname string) bool {
	dir, err := os.Open(dirname)
	if err != nil {
		Logger.Infof("error opening directory: %s", err)
	}
	defer func() {
		_ = dir.Close()
	}()
	results, _ := dir.Readdir(1)
	return len(results) == 0
}
1357435
func IsDir(path string, fs afero.Fs) (bool, error) {
	return afero.IsDir(fs, path)
}
5668
func (s *Store) IsDir(ctx context.Context, name string) bool {
	path := filepath.Join(s.path, filepath.Clean(name))
	isDir := fsutil.IsDir(path)
	out.Debug(ctx, "fs.Isdir(%s) - %s -> %t", name, path, isDir)
	return isDir
}
1134669
func (s *Store) IsDir(ctx context.Context, name string) bool {
	ls, err := s.List(ctx, name)
	if err != nil {
		return false
	}
	return len(ls) > 1
}
216509
func (fs *FSObjects) getUploadIDDir(bucket, object, uploadID string) string {
	return pathJoin(fs.fsPath, minioMetaMultipartBucket, getSHA256Hash([]byte(pathJoin(bucket, object))), uploadID)
}
763541
func IsDir(directory string) bool {
	fileInfo, err := os.Stat(directory)
	if err != nil {
		return false
	}
	return fileInfo.IsDir()
}
1367619
func IsOrgModeFile(name string) bool {
	extension := strings.ToLower(filepath.Ext(name))
	for _, ext := range orgModeExtensions {
		if strings.ToLower(ext) == extension {
			return true
		}
	}
	return false
}
525520
func (m *InMem) IsDir(ctx context.Context, name string) bool {
	m.Lock()
	defer m.Unlock()

	for k := range m.data {
		if strings.HasPrefix(k, name+"/") {
			return true
		}
	}
	return false
}
302875
func (d *initData) KubeConfigDir() string {
	if d.dryRun {
		return d.dryRunDir
	}
	return d.kubeconfigDir
}
1049215
func (s *Store) IsDir(ctx context.Context, name string) bool {
	name = s.prefix + name
	out.Debug(ctx, "consul.IsDir(%s)", name)
	count := 0
	ls, err := s.List(ctx, name)
	if err != nil {
		return false
	}
	for _, e := range ls {
		if strings.HasPrefix(e, name) {
			count++
		}
	}
	return count > 1
}
1140308
func (c *Client) Mkdir(name string) error {
	_, err := c.Files.CreateFolder(&dropbox.CreateFolderInput{name})
	return err
}
1111834
func IsDir(dirPath string) bool {
	fi, err := os.Stat(dirPath)
	if err == nil {
		return fi.IsDir()
	}
	return false
}
177002
func IsDir(dirName string) (dir bool, err error) {
	if lstat, err := os.Lstat(dirName); err != nil {
		if os.IsNotExist(err) {
			return false, nil
		}
		return false, err
	} else {
		if !lstat.IsDir() {
			return false, ErrNotADirectory
		}
	}
	return true, nil
}
854425
func (zh *zipHandler) blobsFromDir(dirPath string, dirBlob blob.Ref) ([]*blobFile, error) {
	var list []*blobFile
	dr, err := schema.NewDirReader(context.TODO(), zh.fetcher, dirBlob)
	if err != nil {
		return nil, fmt.Errorf("Could not read dir blob %v: %v", dirBlob, err)
	}
	ent, err := dr.Readdir(context.TODO(), -1)
	if err != nil {
		return nil, fmt.Errorf("Could not read dir entries: %v", err)
	}
	for _, v := range ent {
		fullpath := path.Join(dirPath, v.FileName())
		switch v.CamliType() {
		case "file":
			list = append(list, &blobFile{v.BlobRef(), fullpath})
		case "directory":
			children, err := zh.blobsFromDir(fullpath, v.BlobRef())
			if err != nil {
				return nil, fmt.Errorf("Could not get list of blobs from %v: %v", v.BlobRef(), err)
			}
			list = append(list, children...)
		}
	}
	return list, nil
}
1338129
func (s *ObjectsClient) IsDir(ctx context.Context, objectPath string) (bool, error) {
	info, err := s.GetInfo(ctx, &GetInfoInput{
		ObjectPath: objectPath,
	})
	if err != nil {
		return false, err
	}
	if info != nil {
		return strings.HasSuffix(info.ContentType, "type=directory"), nil
	}
	return false, nil
}