Create a directory.

@param $dirname
@param $mode
@return bool
439874
private function makeActualDirectory($dirname, $mode)
    {
        $listing = glob($this->current_working_dir . '/*', GLOB_ONLYDIR) ?: [];

        $directories = array_map(function ($value) {
            return pathinfo($value, PATHINFO_BASENAME);
        }, $listing);

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

        return @mkdir($dirname, $mode);
    }
855932
public static function make(string $dir, int $mode = 0755):bool
    {
        //如果存在相同的文件名，则抛出异常
        if (is_file($dir)) {
            throw new \InvalidArgumentException("Invalid directory name. Some file name is same as it.");
        }
        if (is_dir($dir)) {
            return true;
        }
        return mkdir($dir, $mode, true);
    }
413035
public function mkdir(string $dirName): bool
    {
        return mkdir($this->fileInfo->getAbsoluteFilePath() . MDir::getSeparator() . $dirName);
    }
735149
public function mkdir($dirs, $mode = 0777)
    {
        foreach ($this->toIterable($dirs) as $dir) {
            if (is_dir($dir)) {
                continue;
            }

            if (!self::box('mkdir', $dir, $mode, true)) {
                if (!is_dir($dir)) {
                    // The directory was not created by a concurrent process. Let's throw an exception with a developer friendly error message if we have one
                    if (self::$lastError) {
                        throw new IOException(sprintf('Failed to create "%s": %s.', $dir, self::$lastError), 0, null, $dir);
                    }
                    throw new IOException(sprintf('Failed to create "%s"', $dir), 0, null, $dir);
                }
            }
        }
    }
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;
    }
378792
static function createDirectory($dirPath, $permissions = 0755)
    {
        if (!is_dir($dirPath)) {
            try {
                return mkdir($dirPath, $permissions, true) && chmod($dirPath, $permissions);
            } catch (\Throwable $throwable) {
                return false;
            }
        } else {
            return true;
        }
    }
1043697
public function makeDirectory($mode = FileSystemPermission::NORMAL)
    {
        $directory = $this->factory->makeDirectory($mode);
        $this->container->add($directory);

        return $directory;
    }
441289
public function make($mode = 0777) {
		if (!$this->exists() && !@mkdir($this->pathname, $mode, true)) {
			throw new FileException(sprintf('Failed to create directory "%s"', $this->pathname));
		}
	}
852152
public function moveToDir($dir, $mode=null) {
		if($this->isIn($dir))
			return;
		return $this->rename($dir.'/'.$this->getName(), $mode);
	}
454609
protected static function recursiveMakeDirectory(string $dir, int $mode = 0777): bool {
		return (is_dir(dirname($dir)) || static::recursiveMakeDirectory(dirname($dir))) ? mkdir($dir, $mode) : true;
	}
393444
public function makeDir($dir_path)
    {
        $fm = new Filesystem();
        if (!file_exists($dir_path)) {
            $fm->mkdir($dir_path, 0755);
        } else {
            $this->getFileManager()
                ->throwError("Cannot create directory '" . $dir_path . "': Directory already exists", 500);
        }
    }
1066992
public function makeDirectory($dirname, $mode = 0777, $recursive = false, array $option = [])
    {
        if (is_array($mode)) {
            $option = $mode;

            $mode = 0777;
        }

        if (is_array($recursive)) {
            $option = $recursive;

            $recursive = false;
        }
    }
229849
public function createFolder( $folderName )
	{
		$this->connection->checkConnection();
		return (bool) ftp_mkdir( $this->connection->getResource(), $folderName );
	}
655639
public function handle($dirname, $mode, $options)
    {
        $dirname = Util::normalizePath($dirname);

        $adapter = $this->filesystem->getAdapter();

        // If recursive, or a single level directory, just create it.
        if (($options & STREAM_MKDIR_RECURSIVE) || strpos($dirname, '/') === false) {
            return (bool) $adapter->createDir($dirname, $this->defaultConfig());
        }

        if ( ! $adapter->has(dirname($dirname))) {
            throw new FileNotFoundException($dirname);
        }

        return (bool) $adapter->createDir($dirname, $this->defaultConfig());
    }
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);
	}
17804
public function create($filePath = null, $mode = 'wb')
    {
        $filePath = isset($filePath) ? $filePath : $this->filePath;
        $dir = dirname($filePath);

        if ( ! is_writable($dir)) {
            if ( ! file_exists($dir)) {
                mkdir($dir, 0777, true);
            }
        }

        if ( ! $fp = @fopen($filePath, $mode)) {
            return false;
        }

        parent::__construct($filePath);

        return $fp;
    }
1059167
public static function createDir($dirPath, $mode = 0711)
    {
        if (false === file_exists($dirPath)) {
            if (false === mkdir($dirPath, $mode, true)) {
                throw new RuntimeException(sprintf('unable to create directory "%s"', $dirPath));
            }
        }
    }