create a directory.

@return bool false if the directory did already exist
6933
public static function create($dir, $chmod = null)
    {
        if (!file_exists($dir)) {
            if ($chmod === null) {
                $chmod = self::$defaultChmod;
            }
            mkdir($dir, $chmod, true);
            // php mkdir apply umask on the given mode, so we must to
            // do a chmod manually.
            chmod($dir, $chmod);
            return true;
        }

        return false;
    }
1150335
public function makeDir($path)
    {
        if (empty($path)) return false;
        $dir = explode("/", $path);
        $path = ftp_pwd($this->linkid) . '/';
        $ret = true;
        for ($i=0; $i<count($dir); $i++) {
            $path = $path . $dir[$i] . '/';
            if (!@ftp_chdir($this->linkid, $path)) {
                if (!@ftp_mkdir($this->linkid, $dir[$i])) {
                    $ret = false;
                    break;
                }
            }
            @ftp_chdir($this->linkid, $path);
        } 
        if (!$ret) return false;
        return true;
    }
746408
def create_dir(directory):
    
    if not os.access(directory, os.F_OK):
        os.makedirs(directory)
    return os.path.abspath(directory)
379648
public function actionFolderCreate() {
		$source = $this->getSource();
		$destinationPath = $source->getPath();

		$this->accessControl->checkPermission($this->getUserRole(), $this->action, $destinationPath);

		$folderName = Helper::makeSafe($this->request->name);

		if ($destinationPath) {
			if ($folderName) {
				if (!realpath($destinationPath . $folderName)) {
					mkdir($destinationPath . $folderName, $source->defaultPermission);
					if (is_dir($destinationPath . $folderName)) {
						return ['messages' => ['Directory successfully created']];
					}
					throw new \Exception('Directory was not created', Consts::ERROR_CODE_NOT_EXISTS);
				}
				throw new \Exception('Directory already exists', Consts::ERROR_CODE_NOT_ACCEPTABLE);
			}
			throw new \Exception('The name for new directory has not been set', Consts::ERROR_CODE_NOT_ACCEPTABLE);
		}
		throw new \Exception('The destination directory has not been set', Consts::ERROR_CODE_NOT_ACCEPTABLE);
	}
1324692
public function createClusteredConfiguration()
    {
        $retval = false;

        if ($this->apache_config_path) {
            $index_list = $this->nb_server->getSitesIndex();
            $index_list->iterate(
                function ($site_key, $nb_site) {
                    $this->createSiteFolders($nb_site);
                    $this->createClusteredFile($nb_site);

                    return true;
                }
            );
            $this->createClusteredIndex($index_list);
            $retval = true;
        }

        return $retval;
    }
1132171
def make_dir(cls, directory_name):
        """"""
        if not os.path.exists(directory_name):
            os.makedirs(directory_name)
105036
protected function makeFinder()
    {
        $directories = RootDirectories::getEnforceable();
        $found = [];

        $filesystem = new Filesystem();

        foreach ($directories as $directory) {
            if ($filesystem->exists($directory) && is_dir($directory)) {
                $found[] = $directory;
            }
        }

        return DefaultFinder::create()->in($found);
    }
251236
public static function createDirectoryRecursively($dir)
    {
        if (DIRECTORY_SEPARATOR === "\\") {
            $dir = str_replace("/", "\\", $dir);
        }
        else if (DIRECTORY_SEPARATOR === "/") {
            $dir = str_replace("\\", "/", $dir);
        }

        $_config =& CKFinder_Connector_Core_Factory::getInstance("Core_Config");
        if ($perms = $_config->getChmodFolders()) {
            $oldUmask = umask(0);
            $bCreated = @mkdir($dir, $perms, true);
            umask($oldUmask);
        }
        else {
            $bCreated = @mkdir($dir, 0777, true);
        }

        return $bCreated;
    }
877637
public function createFolder()
    {
        if ($this->storage->exists($this)) {
            return false;
        }

        $this->storage->makeDirectory(0777, true, true);
    }
258640
def _create(self):
        """"""

        self._raise_if_none()
        if not self._exists:
            mkdir_p(self.path)
            self._exists = True
48767
def create_dir_unless_exists(*args):
    """"""
    path = os.path.join(*args)
    if not os.path.isdir(path):
        os.makedirs(path)
1354811
public function create()
    {
        $folder = $this->getBackupFolder();

        $files = $this->backupFiles($folder);
        $db = $this->backupDatabase($folder);

        $resultFilename = $this->getBackupFilename();
        $archiveFile = dirname($folder) . DIRECTORY_SEPARATOR . $resultFilename . '.tar';

        // Create new archive
        $archive = new \PharData($archiveFile);

        // add folder
        $archive->buildFromDirectory($folder);

        // Remove temp directory
        FileHelper::removeDirectory($folder);

        return $archiveFile;
    }
454837
public function dir()
    {
        $this->_name = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid($this->_prefix);
        if (!mkdir($this->_name)) {
            throw new \Exception('Cannot create temporary directory');
        }
        return $this;
    }
1184369
public function create_directory($newdirname, $userid = NULL) {
        if (!$this->is_writable() or !$this->lf->is_directory()) {
            return null;
        }

        $newdirname = clean_param($newdirname, PARAM_FILE);
        if ($newdirname === '') {
            return null;
        }

        $filepath = $this->lf->get_filepath().'/'.$newdirname.'/';

        $fs = get_file_storage();

        if ($file = $fs->create_directory($this->lf->get_contextid(), $this->lf->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid(), $filepath, $userid)) {
            return $this->browser->get_file_info($this->context, $this->lf->get_component(), $file->get_filearea(), $file->get_itemid(), $file->get_filepath(), $file->get_filename());
        }
        return null;
    }
288861
public function createOutputDir()
    {
        $outputDir = $this->configuration->get('output');

        if (!is_writable($outputDir)) {
            @mkdir($outputDir, 0777, true);

            if (!is_writable($outputDir)) {
                throw new \RuntimeException("Output directory {$outputDir} is not writable.");
            }
        }
    }
231337
def create_directory(self, path=None):
        
        if path is None:
            path = self.get_path()
        if not os.path.exists(path):
            os.makedirs(path)
1272349
public function makeDirectory($dirname, $mode = 0777)
    {
        $directories = explode('/', $dirname);

        foreach ($directories as $directory) {
            if (false === $this->makeActualDirectory($directory, $mode)) {
                chdir($this->base_directory);
                return false;
            }
            chdir($directory);
            $this->current_working_dir = getcwd();
        }

        chdir($this->base_directory);

        return true;
    }