Create a directory.

@param string $directory

@return bool
963547
protected function makeActualDirectory($directory, $mode)
    {
        $connection = $this->getConnection();

        $directories = ftp_nlist($connection, '.') ?: [];

        // Remove unix characters from directory name
        array_walk($directories, function ($dir_name, $key) {
            return preg_match('~^\./.*~', $dir_name) ? substr($dir_name, 2) : $dir_name;
        });


        // Skip directory creation if it already exists
        if (in_array($directory, $directories, true)) {
            return true;
        }

        return ftp_mkdir($connection, $directory);
    }
81309
public static function fromDirectory(string $directory): self
    {
        $exception = new self(\sprintf(
            'Directory "%s" does not exist.',
            $directory
        ));

        $exception->directory = $directory;

        return $exception;
    }
937381
public function setCurrentDirectory($directory)
    {
        $directory = $this->normalizePath("$this->baseDir/$directory");

        $this->checkIfPathInBaseDir($directory);

        $this->currentDir = $directory;

        return $this;
    }
525110
public function loadDirectory($directory) {
        $iterator = new DirectoryIterator($directory);
        foreach($iterator as $file) {
            if($file->isFile() && ends_with($file->getFilename(), '.php')) {
                require $directory . '/' . $file->getFilename();
            }
        }
    }
118962
private function createIterator($directory)
    {
        $directoryIterator = new RecursiveDirectoryIterator($directory,
            FilesystemIterator::CURRENT_AS_FILEINFO |
            FilesystemIterator::KEY_AS_PATHNAME |
            FilesystemIterator::SKIP_DOTS
        );

        $filterIterator = new RecursiveIteratorIterator($directoryIterator,
            RecursiveIteratorIterator::LEAVES_ONLY);

        return $filterIterator;
    }
673671
public function makeDirectory($path)
    {
        event(new Events\DirectoryCreating($path));
        $created = $this->disk()->makeDirectory($path);
        event(new Events\DirectoryCreated($path, $created));

        return $created;
    }
239413
public function createDirectory($directory, $chmod = null, $recurisve = true)
    {
        $chmod     = $chmod ?: $this->chmod;
        $directory = sprintf('%s/%s', $this->rootDir, trim($directory, '/'));

        if (!$this->fileSystem->exists($directory)) {
            try {
                $this->fileSystem->mkdir($directory);
            } catch (FsIOException $e) {
                throw new IOException($e->getMessage(), $e->getCode(), $e);
            }
        }

        return true;
    }
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;
    }
193036
public function create() {
        if ($this->exist()) {
            return true;
        }
        $args = explode('/', str_replace('\\', '/', $this->fullName));
        $directory = '';
        $result = true;
        foreach ($args as $item) {
            $directory .= $item . '/';
            if (!is_dir($directory) && !empty($directory)) {
                $result = mkdir($directory);
            }
        }
        return $result;
    }
484579
protected function createDirectory($directory)
    {
        $umask = umask(0);
        $created = mkdir($directory, 0777, true);
        umask($umask);

        if (!$created) {
            throw new StorageException(StorageException::DIRECTORY_COULD_NOT_BE_CREATED, [$directory]);
        }
    }
325158
protected function makeDir($dir)
    {
        $dirPath = base_path('app/'.ltrim($dir, '/'));

        if (!File::exists($dirPath)) {
            File::makeDirectory($dirPath);
        }
    }
139422
public function mkDirRecursive($dir)
	{
		$parts = explode('/', $dir);
		$path = '';
		while (!empty($parts)) {
			$path .= array_shift($parts);
			try {
				if ($path !== '') $this->mkdir($path);
			} catch (FtpException $e) {
				if (!$this->isDir($path)) {
					throw new FtpException("Cannot create directory '$path'.");
				}
			}
			$path .= '/';
		}
	}
635484
public function setDirectory($directory)
	{
		$this->directory = $directory;

		// Set the finder to use this directory as well
		$this->finder->in($directory);

		return $this;
	}
721553
public function setDirectory(Directory $directory)
    {
        $this->directory = $directory;
        $this->iterator = new \ArrayIterator($directory->children());
    }
826931
public function mkdir($directory) {
        if (false === @ftp_mkdir($this->getConnection(), $directory)) {
            throw $this->newFTPException(sprintf("mkdir %s failed", $directory));
        }
        return $this;
    }
438907
public function isDirectory($directory)
	{
		$directory = Util::normalizePath($directory);

		return (bool) $this->adapter->isDirectory($directory);
	}
1295562
protected function createParentDirectory($directory)
    {
        if (! $this->files->isDirectory($directory)) {
            $this->files->makeDirectory($directory, 0755, true);
        }
    }