Creates a directory.

@param string $dir
770128
public function mkdir($dir)
    {
        if (!is_dir($dir)) {
            if (false === @mkdir($dir, $this->mode, true)) {
                $error = error_get_last();
                if (!is_dir($dir)) {
                    if ($error) {
                        throw new IOException(
                            sprintf('Failed to create "%s": %s.', $dir, $error['message']),
                            0,
                            null,
                            $dir
                        );
                    }
                    throw new IOException(sprintf('Failed to create "%s"', $dir), 0, null, $dir);
                }
            }
        }
    }
974946
public function emptyDir($directory)
    {
        [$fs, $directory] = $this->getFilesystemAndPath($directory);

        $fs->emptyDir($directory);
    }
1221697
protected function makeFolder($dir)
    {
        if (!is_dir($dir)) {
            $parent = \dirname($dir);
            try {
                $this->makeFolder($parent);
                $this->filesystem->mkdir($dir);
                $this->filesystem->chmod($dir, $this->folderPermissions);
            } catch (IOException $e) {
                throw new \RuntimeException(sprintf('Could not create directory %s', $dir), 0, $e);
            }
        }
    }
1328639
public static function create(string $dir = ''): bool
    {
        $ret = true;
        $dir = static::normalizePath($dir);
        if (static::verifyPath($dir) && !\file_exists($dir)) {
            $components = \explode(DIRECTORY_SEPARATOR, $dir);
            $newDirectory = '';

            foreach ($components as $component) {
                $newDirectory .= $component.DIRECTORY_SEPARATOR;
                if (static::verifyPath($dir) && !\file_exists($newDirectory)) {
                    @\mkdir($newDirectory, static::$newDirectoryMode);
                    @\chmod($newDirectory, static::$newDirectoryMode);
                }
            }
            return \file_exists($dir) ? true : false;
        }
        return $ret;
    }
337709
public function setCompileDir($dir)
    {
        $this->compileDir = rtrim($dir, '/\\') . DIRECTORY_SEPARATOR;
        if (!file_exists($this->compileDir)) {
            mkdir($this->compileDir, 0777, true);
        }
        if (is_writable($this->compileDir) === false) {
            throw new Exception('The compile directory must be writable, chmod "' . $this->compileDir . '" to make it writable');
        }
    }
835138
public function createDirectory($directory)
    {
        if (true === is_dir($directory)) {
            return true;
        }

        return Silencer::call('mkdir', $directory, 0777, true);
    }
92647
protected function _createDirectory($dir)
    {
        $old = umask(0);
        // @codingStandardsIgnoreStart
        $result = @mkdir($dir, 0755, true);
        // @codingStandardsIgnoreEnd
        umask($old);

        if ($result) {
            $this->out('Created directory ' . $dir);

            return true;
        }

        $this->err('Failed creating directory ' . $dir);

        return false;
    }
397585
static public function
	MakeDirectory($dir) {
	/*//
	@argv string Directory
	@return bool

	make a directory. returns if successful or not. allows you to
	blindly call it if it already exists to ensure it exists.
	//*/

		// if it already exists...
		if(is_dir($dir)) return true;

		// make it...
		$umask = umask(0);
		@mkdir($dir,0777,true);
		umask($umask);

		// find out if it was successful, lol.
		return is_dir($dir);
	}
1079763
protected function ensureDirectory($dir)
    {
        if (isset($this->dirCache[$dir])) {
            return;
        }

        if ($this->filesystem->isDirectory($dir)) {
            $this->dirCache[$dir] = true;
            return;
        }

        if (!@$this->filesystem->makeDirectory($dir)) {
            throw new RuntimeException("Cannot create base directory '$dir'");
        }

        $this->dirCache[$dir] = true;
    }
713731
public function setDirectory($dir)
    {
        if(!is_dir($dir) && !mkdir($dir, 0775, true)) {
            throw new \Dropbox\Exception('Unable to create directory ' . $dir);
        } else {
            $this->tokenDirectory = $dir;
        }
    }
1132171
def make_dir(cls, directory_name):
        """"""
        if not os.path.exists(directory_name):
            os.makedirs(directory_name)
646215
def create_directory(directory):
    """"""
    if os.path.exists(directory):
        rmtree(directory)
    os.makedirs(directory)
    return directory
462807
protected function makeDirs($directory)
	{
		foreach ($directory as $path) {
			if (!$this->files->isDirectory($this->getPath($path))){
				$this->files->makeDirectory($this->getPath($path), 0777, true);
			}
		}
	}
333982
public static function SetDirectory($dir) {
    if (!is_dir($dir)) {
      if (!@\mkdir($dir, 0700, TRUE)) {
        throw new \InvalidArgumentException("dir $dir does not exist and could not be created");
      }
    }

    self::$DIR = realpath($dir);
  }
319251
public function setLogDir($dir)
    {
        $dir = str_replace("\\", "/", $dir);
        $dir = rtrim($dir, '/');
        
        $this->logDir = $dir;
    }
802889
public function dirDelete($dir)
    {
        $dir = $this->alias->resolve($dir);

        if (!is_dir($dir)) {
            return;
        }

        $this->_dirDelete($dir);
    }
85405
public function setTmpDir ($dir)
		{
			$this->_tmpDir = $dir . '/' . $this->_params[ 'identifier' ];
			if (!is_dir($this->_tmpDir))
				FileHelper::createDirectory($this->_tmpDir);
		}