Create directories if they don't exist
@param  {array} arrPaths - the directory path(s)
346291
function createDirs(arrPaths) {
  arrPaths.forEach(path => {
    if (!fs.existsSync(path)) {
      fs.mkdirSync(path);
    }
  });
}
844526
function _rmdirp (directory, callback) {

			if ("undefined" === typeof directory) {
				throw new ReferenceError("missing \"directory\" argument");
			}
				else if ("string" !== typeof directory) {
					throw new TypeError("\"directory\" argument is not a string");
				}
				else if ("" === directory.trim()) {
					throw new Error("\"directory\" argument is empty");
				}
			else if ("undefined" === typeof callback) {
				throw new ReferenceError("missing \"callback\" argument");
			}
				else if ("function" !== typeof callback) {
					throw new TypeError("\"callback\" argument is not a function");
				}
			else {

				isDirectoryProm(directory).then((exists) => {

					return !exists ? Promise.resolve() : _emptyDirectoryProm(directory).then(() => {

						return new Promise((resolve, reject) => {

							rmdir(directory, (err) => {
								return err ? reject(err) : resolve();
							});

						});

					});

				}).then(() => {
					callback(null);
				}).catch(callback);

			}

		}
1149472
@Override
    public T addAsDirectories(final ArchivePath... paths) throws IllegalArgumentException {
        // Precondition check
        Validate.notNull(paths, "paths must be specified");

        // Add
        for (final ArchivePath path : paths) {
            this.addAsDirectory(path);
        }

        // Return
        return covariantReturn();
    }
1178972
function(/**Array*/ path) {
		if (path.constructor != Array) path = path.split(/[\\\/]/);
		var make = "";
		for (var i = 0, l = path.length; i < l; i++) {
			make += path[i] + SYS.slash;
			if (! IO.exists(make)) {
				IO.makeDir(make);
			}
		}
	}
146252
function createParentDirectories(path, callback) {
    (new fs.Shell()).mkdirp(Path.dirname(path), function(err) {
      if(err && err.code !== 'EEXIST') {
        return callback(err);
      }

      callback();
    });
  }
570
def safe_makedirs(path):
    """"""
    try:
        os.makedirs(path)
    except OSError as err:
        if err.errno == errno.EEXIST:
            if not os.path.isdir(path):
                raise
        else:
            raise
1064458
function mkdir(path, fn) {
  shell.mkdir('-p', path);
  shell.chmod(755, path);
  console.log(chalk.cyan('   create:'), path);
  if (fn) fn();
}
986913
function (urlpath, dirs) {
    dirs.forEach(function (val, idx) {
        redirectTo(urlpath, false);
        addDeepDir(urlpath, val);
    });
}
1305053
def createpath(path, mode, exists_ok=True):
    
    try:
        os.makedirs(path, mode)
    except OSError, e:
        if e.errno != errno.EEXIST or not exists_ok:
            raise e
470678
protected function createDirectory($paths)
    {
        if (!is_array($paths)) {
            $paths = array($paths);
        }

        foreach ($paths as $path) {
            if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) {
                // @codeCoverageIgnoreStart
                throw new \RuntimeException(sprintf('Unable to create directory "%s".', $dir));
                // @codeCoverageIgnoreEnd
            }
        }
    }
1262796
def ensure_dir_exists(path):
    
    dir_path = os.path.dirname(path)
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
1019822
def directories=(directories)
      valid = []

      if directories
        directories.each do |dir|
          unless File.directory?(dir)
            raise ArgumentError, "The directory #{dir} does not exist"
          end

          valid << File.expand_path(dir)
        end
      end

      @directories = valid
    end
951651
def _create_path_if_not_exist(self, path):
        
        if path and not os.path.exists(path):
            os.makedirs(path)
235710
function mkdirIfNotExists(relativePath) {
    const dir = path.join(__dirname, relativePath);
    let stat;
    try {
        stat = fs.statSync(dir);
    } catch (e) {
        fs.mkdirSync(dir);
    }
}
723246
function createFileTree (filePaths)
{
  var path = require ('path')
    , root = {
    files:      [],
    subfolders: new Map
  };

  filePaths.forEach (function (filename)
  {
    var dir = path.dirname (filename)
      , folderPtr = root;
    if (dir)
      dir.split (path.sep).forEach (function (segment)
      {
        if (!folderPtr.subfolders.has (segment))
          folderPtr.subfolders.set (segment, {
            files:      [],
            subfolders: new Map
          });
        folderPtr = folderPtr.subfolders.get (segment);
      });
    folderPtr.files.push (filename);
  });
  return root;
}
1113957
def makedirs(path)
      route = []
      File.split(path).each do |dir|
        route << dir
        current_dir = File.join(route)
        if @created[current_dir].nil?
          @created[current_dir] = true
          $stderr.puts "Creating Directory  #{current_dir}" if @verbose
          @ftp.mkdir(current_dir) rescue nil
        end
      end
    end
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;
  }