make directory
@param string $directory
504963
protected function _makeDirectory( $directory )
    {
        try
        {
            if ( !is_dir( $directory ) && !is_file( $directory ) && !is_link( $directory ) )
            {
                mkdir( $directory, 0755, true );
            }
        }
        catch ( \Exception $e )
        {
            $this->error( $e->getMessage() );
            die;
        }
    }
959637
private function createDirectory($directory)
    {
        if (!file_exists($directory)) {
            // Let's create the directory:
            $old = umask(0);
            $result = @mkdir($directory, 0775, true);
            umask($old);

            return $result;
        }

        return true;
    }
15402
protected function createDirectory($directory)
    {
        // create parent directory if needed
        $parent = \Gaufrette\Util\Path::dirname($directory);
        if (!$this->isDir($parent)) {
            $this->createDirectory($parent);
        }

        // create the specified directory
        $created = ftp_mkdir($this->getConnection(), $directory);
        if (false === $created) {
            throw new \RuntimeException(sprintf('Could not create the \'%s\' directory.', $directory));
        }
    }
932022
public function setDirectory($directory = __DIR__)
    {
        if (!is_dir($directory)) {
            $message = "Directory {$directory} doesn't exist.";
            throw new \RuntimeException($message);
        }
        $this->directory = $directory;
        $this->gitattributesFile = $directory
            . DIRECTORY_SEPARATOR
            . '.gitattributes';

        return $this;
    }
569022
public static function create($directory = '')
    {
        if (empty($directory) || !file_exists($directory)) {
            $directory = sys_get_temp_dir();
        }

        return new Wrapper($directory);
    }
1175420
protected function createDirectory($directory)
    {
        $isCreated = file_exists($directory) || is_dir($directory) || mkdir($directory, 0777, true);
        
        if (!$isCreated)
            throw new RuntimeException('Cannot create directory ":dir" for generated classed', ['dir' => $directory]);
        
        return $this;
    }
1261626
protected function makeDir($directory)
	{
		if ( ! $this->files->isDirectory($this->getPath($directory)))
		{
			$this->files->makeDirectory($this->getPath($directory), 0777, true);
		}
	}
688090
public function setDirectory($directory)
	{
		// trim trailling slash
		$directory = rtrim($directory,"/");
		$dir       = opendir($directory);
		if ($dir === false)
		{
			throw new UnableToSetException("Could not set '$directory'. It is not a directory!");
		}


		while (($file = readdir($dir)) !== false)
		{
			$path      = $directory.'/'.$file;
			$pathInfo  = pathinfo($path);
			$extension = strtolower($pathInfo['extension']);
			$filename  = $pathInfo['filename'];
			if ($extension == 'php')
			{
				$strings = include $path;
				if (is_array($strings))
				{
					$this->collection->setArray($strings, $filename);
				}
			}
		}
		return $this;
	}
661303
protected function emptyDirectory($directory)
    {
        foreach ($this->doListContents($directory, true) as $path) {
            $this->deletePath($path);
        }
    }
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);
            }
        }
    }
355259
public function mkdir($dir) {
		$this->connectIfNeeded();
		$this->handle->mkdir($dir);
		$this->onFolderCreated(new Event(['sender' => $this, 'data' => $dir]));
	}
1221998
public static function autocreate_directory($directory)
    {
        if (!file_exists($directory)) {
            mkdir($directory, 0777, true);
        }

        if (!is_writable($directory)) {
            throw new \Exception("Directory \"{$directory}\" is not writable");
        }
    }
363982
public static void createDirectories(final String directory) {
        if (directory == null) return;
        final File f = new File(directory);
        if (!f.isDirectory()) {
            if (!f.mkdirs()) throw new RuntimeException("couldn't create "
                    + directory);
        }
    }
974946
public function emptyDir($directory)
    {
        [$fs, $directory] = $this->getFilesystemAndPath($directory);

        $fs->emptyDir($directory);
    }
46493
private function createDirectory(string $directory, int $mode): bool {
    $auth = false;
    if (is_dir($directory)) {
      $auth = true;
    } else {
      @mkdir($directory, $mode, true);
    }
    @chmod($directory, $mode);
    return is_dir($directory);
  }
180568
protected function createDirectory($directory)
    {
        if (!$this->files->isDirectory($directory)) {
            $this->files->makeDirectory($directory, 0755, true);
        }
    }
575816
public function setTemplatesDirectory($directory)
    {
        $this->templatesDirectory = rtrim($directory, DIRECTORY_SEPARATOR);
		$this->engine->setDirectory($this->getTemplatesDirectory());
    }