Creates a directory. Produces information in case of dry run.
    Issues error where necessary.
558427
def make_dir(dst_dir, dry_run, print_func, recursed):
    
    parent = os.path.split(dst_dir.rstrip('/'))[0] # Check for nonexistent parent
    parent_files = auto(listdir_stat, parent) if parent else True # Relative dir
    if dry_run:
        if recursed: # Assume success: parent not actually created yet
            print_func("Creating directory {}".format(dst_dir))
        elif parent_files is None:
            print_func("Unable to create {}".format(dst_dir))
        return True
    if not mkdir(dst_dir):
        print_err("Unable to create {}".format(dst_dir))
        return False
    return True
253130
def create_dir(self, params, delete=False):
        
        # create experiment path and subdir
        fullpath = os.path.join(params['path'], params['name'])
        self.mkdir(fullpath)

        # delete old histories if --del flag is active
        if delete and os.path.exists(fullpath):
            os.system('rm %s/*' % fullpath)
     
        # write a config file for this single exp. in the folder
        self.write_config_file(params, fullpath)
882202
private static String createIfNeeded(String dir) {
        File f = new File(dir);
        if (f.exists()) {
            return dir;
        } else {
            boolean success = f.mkdirs();
            if (success)
                return dir;
            else
                return null;
        }
    }
157617
public static File createDir(String dir) {
        // create outdir
        File directory = null;
        if(dir != null) {
            directory = new File(dir);
            if(!(directory.exists() || directory.mkdir())) {
                Utils.croak("Can't find or create directory " + dir);
            }
        }
        return directory;
    }
231337
def create_directory(self, path=None):
        
        if path is None:
            path = self.get_path()
        if not os.path.exists(path):
            os.makedirs(path)
985741
def make_dirs(path):
        
        try:
            os.makedirs(os.path.dirname(path))
        except OSError as err:
            if err.errno != errno.EEXIST:
                LOGGER.error('Failed to create directory %s with error: %s' % (path, str(err)))
                raise
1052042
void createDirectory(Path path) throws IOException {
		if (Files.exists(path) && Files.isDirectory(path)) {
			return;
		}

		if (this.readOnly) {
			throw new FileNotFoundException(
					"The requested directory \""
							+ path.toString()
							+ "\" does not exist and we are in read-only mode, so it cannot be created.");
		}

		Files.createDirectory(path);
	}
1245157
def ensure_dir(self, mode=0777):
        
        if not self.exists() or not self.isdir():
            os.makedirs(self, mode)
1036687
function createDirectories(done) {
		debug('createDirectories()');
		var paths = [ options.output ];
		function iterator(dirpath, next) { mkdirp(dirpath, '0755', next); };
		async.forEach(paths, iterator, done);
	}
1150533
def makedirs(self, path, mode=0x777):
        ""
        self.directory_create(path, mode, [library.DirectoryCreateFlag.parents])
33905
public static FileCreationState newDirectory(final File dir)
	{
		FileCreationState fileCreationState = FileCreationState.ALREADY_EXISTS;
		// If the directory does not exists
		if (!dir.exists())
		{ // then
			fileCreationState = FileCreationState.FAILED;
			// create it...
			if (dir.mkdir())
			{
				fileCreationState = FileCreationState.CREATED;
			}
		}
		return fileCreationState;
	}
238374
public static void createDirectory( File directory ) throws IOException {

		if( ! directory.exists()
				&& ! directory.mkdirs())
			throw new IOException( "The directory " + directory + " could not be created." );
	}
1042261
def create_directory(self, filename):
        """"""
        path = os.path.join(self.path, filename)
        makedirs(path)
        return path
912603
def ensure_dir(dir_path):
    
    exists = dir_exists(dir_path)
    if not exists:
        try:
            os.makedirs(dir_path)
        except(Exception,RuntimeError), e:
            raise Exception("Unable to create directory %s. Cause %s" %
                            (dir_path, e))
    return exists
652564
def create_dirs(self):
        
        if not os.path.isdir(self._path):
            os.makedirs(self._path)
        for dir_name in [self.OBJ_DIR, self.TMP_OBJ_DIR, self.PKG_DIR, self.CACHE_DIR]:
            path = os.path.join(self._path, dir_name)
            if not os.path.isdir(path):
                os.mkdir(path)
        if not os.path.exists(self._version_path()):
            self._write_format_version()
346061
def create_directories(self, create_project_dir=True):
        
        return task.create_directories(self.datadir, self.sitedir,
            self.target if create_project_dir else None)
133376
def create_required_directories(self):
        """"""
        required = (self.CACHE_DIR,
                    self.LOG_DIR,
                    self.OUTPUT_DIR,
                    self.ENGINEER.JINJA_CACHE_DIR,)

        for folder in required:
            ensure_exists(folder, assume_dirs=True)