Create all parent directories for a file
    :param blobxfer.models.azure.StorageEntity ase: Azure StorageEntity
    :param dict dirs_created: directories already created map
    :param int timeout: timeout
334819
def create_all_parent_directories(ase, dirs_created, timeout=None):
    # type: (blobxfer.models.azure.StorageEntity, dict, int) -> None
    
    dirs = pathlib.Path(ase.name).parts
    if len(dirs) <= 1:
        return
    # remove last part (which is the file)
    dirs = dirs[:-1]
    dk = ase.client.account_name + ':' + ase.container
    for i in range(0, len(dirs)):
        dir = str(pathlib.Path(*(dirs[0:i + 1])))
        if dk not in dirs_created or dir not in dirs_created[dk]:
            ase.client.create_directory(
                share_name=ase.container,
                directory_name=dir,
                fail_on_exist=False,
                timeout=timeout)
            if dk not in dirs_created:
                dirs_created[dk] = set()
            dirs_created[dk].add(dir)
704042
def build_dirs(files):
    '''
    
    '''
    for i in files:
        if type(i) is list:
            build_dirs(i)
            continue
        else:
            if len(i['path']) > 1:
                addpath = os.path.join(os.getcwd(), *i['path'][:-1])
                subdirs = all_subdirs(os.getcwd())
                if addpath and addpath not in subdirs:
                    os.makedirs(addpath)
                    print 'just made path', addpath
956233
def _makedirs(name, mode=0o777, exist_ok=False):
    
    head, tail = os.path.split(name)
    if not tail:
        head, tail = os.path.split(head)
    if head and tail and not os.path.exists(head):
        try:
            _makedirs(head, exist_ok=exist_ok)
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise
        cdir = os.curdir
        if isinstance(tail, bytes):
            cdir = bytes(os.curdir, "ASCII")
        if tail == cdir:
            return
    try:
        os.mkdir(name, mode)
    except OSError:
        if not exist_ok or not os.path.isdir(name):
            raise
509439
def new_dir(self, name):
        # type: (bytes) -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('Path Table Record already initialized')

        # Zero for the parent dir num is bogus, but that will get fixed later.
        self._new(name, 0)
398981
def create_dirs(path):
    
    fname = os.path.basename(path)

    # if file name exists in path, skip the filename
    if fname.__contains__('.'):
        path = os.path.dirname(path)

    if not os.path.exists(path):
        os.makedirs(path)
1317300
def create_dirs(fname, is_file=False):
    
    fname = os.path.abspath(fname)
    if is_file:
        fname = os.path.dirname(fname)

    if not os.path.exists(fname):
        os.makedirs(fname)
1231516
def create_share(ase, containers_created, timeout=None):
    # type: (blobxfer.models.azure.StorageEntity, dict, int) -> None
    
    # check if auth allows create container
    if not ase.can_create_containers:
        return
    key = ase.client.account_name + ':file=' + ase.container
    if key in containers_created:
        return
    if ase.client.create_share(
            share_name=ase.container,
            fail_on_exist=False,
            timeout=timeout):
        logger.info('created file share {} on storage account {}'.format(
            ase.container, ase.client.account_name))
    # always add to set (as it could be pre-existing)
    containers_created.add(key)
1092584
@Override
    public ICodeBaseLocator createNestedArchiveCodeBaseLocator(ICodeBase parentCodeBase, String path) {
        return new NestedZipFileCodeBaseLocator(parentCodeBase, path);
    }
211066
def create_folder(cls, name, parent=None, project=None,
                      api=None):
        
        api = api or cls._API

        data = {
            'name': name,
            'type': cls.FOLDER_TYPE
        }

        if not parent and not project:
            raise SbgError('Parent or project must be provided')

        if parent and project:
            raise SbgError(
                'Providing both "parent" and "project" is not allowed'
            )

        if parent:
            data['parent'] = Transform.to_file(file_=parent)

        if project:
            data['project'] = Transform.to_project(project=project)

        response = api.post(url=cls._URL['create_folder'], data=data).json()
        return cls(api=api, **response)
746408
def create_dir(directory):
    
    if not os.access(directory, os.F_OK):
        os.makedirs(directory)
    return os.path.abspath(directory)
895287
public static void createParentDirectoryIfNecessary(final File file) {
        final File parentDirectory = file.getParentFile();
        if (parentDirectory == null || parentDirectory.mkdirs() || parentDirectory.exists()) {
            return;
	}
        throw new SdkClientException("Unable to create directory in the path: " + parentDirectory.getAbsolutePath());
    }
495982
def _create_tcex_dirs():
        """"""

        dirs = ['tcex.d', 'tcex.d/data', 'tcex.d/profiles']
        for d in dirs:
            if not os.path.isdir(d):
                os.makedirs(d)
1367407
public static void checkCreateDirectoryOK(Resource resource, boolean createParentWhenNotExists) throws IOException {
	if (resource.exists()) {
	    if (resource.isFile()) throw new IOException("can't create directory [" + resource.getPath() + "], resource already exists as a file");
	    if (resource.isDirectory()) throw new IOException("can't create directory [" + resource.getPath() + "], directory already exists");
	}

	Resource parent = resource.getParentResource();
	// when there is a parent but the parent does not exist
	if (parent != null) {
	    if (!parent.exists()) {
		if (createParentWhenNotExists) parent.createDirectory(true);
		else throw new IOException("can't create file [" + resource.getPath() + "], missing parent directory");
	    }
	    else if (parent.isFile()) {
		throw new IOException("can't create directory [" + resource.getPath() + "], parent is a file");
	    }
	}
    }
468178
def create_blobstore(self, **kwargs):
        
        blobstore = predix.admin.blobstore.BlobStore(**kwargs)
        blobstore.create()

        blobstore.add_to_manifest(self)
        return blobstore
255403
def makedirs(directory):
    
    parent = os.path.dirname(os.path.abspath(directory))
    if not os.path.exists(parent):
        makedirs(parent)
    os.mkdir(directory)
1239195
private static void createParentFile(final File file) throws ExtractionException {
        final File parent = file.getParentFile();
        if (!parent.isDirectory() && !parent.mkdirs()) {
            final String msg = String.format(
                    "Unable to build directory '%s'.",
                    parent.getAbsolutePath());
            throw new ExtractionException(msg);
        }
    }
1092244
public static void createDirectory(Path dir, String dirDesc)
    {
        try
        {
            Files.createDirectories(dir);
        }
        catch (IOException ex)
        {
            throw new WindupException("Error creating " + dirDesc + " folder: " + dir.toString() + " due to: " + ex.getMessage(), ex);
        }
    }