/* Check if a directory exists.
778625
function dirExists(dir, cb) {
  var fsExists = fs.exists || path.exists;
  fsExists(dir, function (exists) {
    if (!exists) {
      return cb(false);
    }
    fs.stat(dir, function (err, stat) {
      if (err) {
        return cb(false);
      }
      return cb(stat.isDirectory());
    });
  });
}
1197293
def _assert_dirs_exist(self, setting_name):
        
        v = self._get_setting(setting_name)
        if (not os.path.isdir(os.path.split(v)[0])) or os.path.isdir(v):
            self.raise_config_error(
                setting_name,
                v,
                str,
                'a file path in an existing directory',
                is_none_allowed=False,
            )
1342242
def _check_dir(self, dirname):
        
        if not os.path.exists(dirname):
            print("Directory %s does not exist!" % dirname)
            sys.exit(1)
272660
function ensureExistsAndClean (dir) {
  if (!fs.existsSync(dir)) {
    fs.mkdirSync(dir)
  } else {
    cleanDir(dir)
  }
}
105662
def check_directory(self):
        """"""
        exists = os.path.exists(self.directory)
        if not exists:
            logger.error("No migrations directory found. Check your path or create a migration first.")
            logger.error("Directory: %s" % self.directory)
        return exists
258197
def is_dir_exists(dirpath):
        # type: (AnyStr) -> bool
        """"""
        if dirpath is None or not os.path.exists(dirpath) or not os.path.isdir(dirpath):
            return False
        else:
            return True
438188
def has_dir(state, fname, incorrect_msg="Did you create a directory named `{}`?"):
    """"""
    if not Path(fname).is_dir():
        state.report(Feedback(incorrect_msg.format(fname)))

    return state
1107577
def check_directory_path(self, path):
        
        if os.path.isdir(path) is not True:
            msg = "Directory Does Not Exist {}".format(path)
            raise OSError(msg)
579111
def checkFileExists(filename, directory=None):
    

    if directory is not None:
        fname = os.path.join(directory,filename)
    else:
        fname = filename
    _exist = os.path.exists(fname)
    return _exist
865962
function isDirectory(filePath) {
	var isDir = false;
	try {
		var absolutePath = path.resolve(filePath);
		isDir = fs.lstatSync(absolutePath).isDirectory();
	} catch (e) {
		isDir = e.code === 'ENOENT';
	}
	return isDir;
}
535084
def ensure_dirs(filename):
    """"""
    dirname = os.path.dirname(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
1002409
function(destPath) {
    var exists, stats;
    var dirpath = path.dirname(destPath);
    try{
      stats = fs.lstatSync(dirpath);
      exists = stats.isDirectory();
    } catch(e) {
      this.createDestDir = dirpath;
    }
    return !!exists;
  }
748617
def assure_directory_exists(path, is_file=False):
    """"""
    if is_file:
        path = osp.dirname(path)
    # END handle file
    if not osp.isdir(path):
        os.makedirs(path)
        return True
    return False
451561
private function checkDir($dir)
    {
        if (! $this->fs->exists($dir)) {
            $this->fs->mkdir($dir);
        }
    }
63697
function existence ( filepath ) {
		var does = grunt.file.exists ( filepath );
		if ( !does ) {
			grunt.log.warn ( filepath + " not found." );
		}
		return does;
	}
375555
function isDirectory(filePath) {
  if (!isExist(filePath)) return false;
  try {
    const stat = fs.statSync(filePath);
    return stat.isDirectory();
  } catch (e) {
    return false;
  }
}
33568
def ensure_dir_exists(path):
    """"""

    import os

    f_dir = os.path.dirname(path)

    if not os.path.exists(f_dir):
        os.makedirs(f_dir)

    return f_dir