Create a directory.

@param int $dirId

@return mixed
515251
public function store($dirId)
    {

        $parentDir = $this->getDirOrFail($dirId);

        if (!$dirName = Input::get('folderName')) {
            $this->flashMessage('dirname-missing');
            return $this->redirectTo('index', $dirId);
        }

        $dir = $this->fileDB->create();
        $dir->setMimeType('inode/directory');

        $dir->setDir($parentDir);
        $dir->setName($dirName);
        $this->fileDB->save($dir);

        return $this->redirectTo('index', [$dir->getId()]);

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

        return new Wrapper($directory);
    }
963578
private function createOrGetFolder($directory, ContainerBuilder $container)
    {
        $filesystem = new Filesystem();

        $directory = $container->getParameterBag()->resolveValue($directory);
        if (!file_exists($directory)) {
            $filesystem->mkdir($directory);
        }

        return $directory;
    }
394237
public function directories($directory)
    {
        $directories = [];

        foreach (Finder::create()->in($directory)->directories()->depth(0)->sortByName() as $dir) {
            $directories[] = $dir->getPathname();
        }

        return $directories;
    }
675345
protected function makeDir($directory)
    {
        if (!$this->filesystem->isDirectory($directory)) {
            $this->filesystem->makeDirectory($directory, 0777, true);
        }
    }
1070412
public function dirReCreate($dir, $mode = 0755)
    {
        $this->dirDelete($dir);

        $this->dirCreate($dir, $mode);
    }
467281
private function getDirectoryIterator(string $directory): \DirectoryIterator
    {
        if ($directory === 'default') {
            return new \DirectoryIterator($this->dataDirectory);
        }
        return new \DirectoryIterator($directory);
    }
713841
public function createDirectory(string $path): Directory {
    $localDirectory = $this->instantiateDir($path);
    $localDirectory->create();
    return $localDirectory;
  }
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;
    }
661666
public static function makeDir($dir) {
		$fs = new Filesystem();
		try {
			$fs->mkdir($dir);
		} catch (IOExceptionInterface $e) {
			Console::writeError("an error occurred while creating your directory at <path>".$e->getPath()."</path>...");
		}
		unset($fs);
	}
924351
public function createDir($dirname, Config $config)
    {
        return $this->client->putObject([
            'Bucket' => $this->getBucket(),
            'Key'    => $dirname.'/',
            'Body'   => '',
        ]);
    }
424769
public function createDir($dirname, array $config = [])
    {
        list($prefix, $dirname) = $this->getPrefixAndPath($dirname);

        return $this->getFilesystem($prefix)->createDir($dirname);
    }
356878
public function directories($directory)
    {
        return collect($this->filesystem->directories($directory))
            ->map(function ($file) {
                return new File($file, $this);
            });
    }
180568
protected function createDirectory($directory)
    {
        if (!$this->files->isDirectory($directory)) {
            $this->files->makeDirectory($directory, 0755, true);
        }
    }
771236
public function dirCreate($dir, $mode = 0755)
    {
        $this->_dirCreate($this->alias->resolve($dir), $mode);
    }
775434
static public function createPathID($dirOrFile)
    {
        $absPath = realpath($dirOrFile);
        if(is_dir($absPath)){
            $id = md5('d'.$absPath);
        }elseif(is_file($absPath)){
            $id = md5('f'.$absPath);
        }else{
            // if not dir or file, returns original $dirOrFile value
            $id = md5($dirOrFile);
        }
        return $id;
    }
311597
public function chdir($dir) {
		$this->connectIfNeeded();
		$this->handle->chdir($dir);
		$this->onFolderChanged(new Event(['sender' => $this, 'data' => $dir]));
		try {
			$cwd = $this->pwd();
		} catch (FtpException $ex) {
			$cwd = $dir;	
		}
		return $cwd;
	}