Create directory with recursive support.
@param string $path
@param int $chmod
@return bool
342302
public static function create($path, $chmod = 0755)
    {
        $path = Normalize::diskFullPath($path);

        if (self::exist($path)) {
            return false;
        }

        return @mkdir($path, $chmod, true);
    }
829659
private function createDir($path, $chmod = 0777, $recursive = true)
    {
        if (!mkdir($path, $chmod, $recursive)) {
            throw new RuntimeException(
                sprintf(
                    'The directory path "%s" could not be created.',
                    $path
                )
            );
        }
    }
894988
protected function makeDirectory($path)
    {
        if (! $this->fileHelper->exists($path)) {
            $this->fileHelper->makeDirectory($path, 0777, true, true);
        }
    }
1282574
public static function chmodr($path, $fileMode) {
		if (!is_dir($path))
			return chmod($path, $fileMode);

		$dh = opendir($path);
		while (($file = readdir($dh)) !== false) {
			if($file != '.' && $file != '..') {
				$fullpath = $path.'/'.$file;
				if(is_link($fullpath))
					return false;
				elseif(!is_dir($fullpath) && !@chmod($fullpath, $fileMode))
						return false;
				elseif(!self::chmodr($fullpath, $fileMode))
					return false;
			}
		}
		closedir($dh);

		if(@chmod($path, $fileMode))
			return true;
		else
			return false;
	}
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);
  }
51581
public static function chmod($path, $mode = null)
  {
    if ($mode) {
      return chmod($path, $mode);
    }

    return substr(sprintf('%o', fileperms($path)), -4);
  }
816436
public static function createFolder($path)
    {
        if (!file_exists($path)) {
            self::createFolder(dirname($path));
            mkdir($path, 0777);
        }
    }
1370566
protected static function chmodPathSingle($path, $dirMode, $fileMode)
    {
        $result = false;

        $dirMode = self::valueToOct($dirMode);
        $fileMode = self::valueToOct($fileMode);

        $result = is_dir($path) ? chmod($path, $dirMode) : chmod($path, $fileMode);
        return $result;
    }
282110
public function makeDirectory($path, $mode = 0755, $recursive = true, $force = false)
	{
		$path = Util::normalizePath($path);

		return (bool) $this->adapter->makeDirectory($path, $mode, $recursive, $force);
	}
1260846
public function createFolder($path)
    {
        $pathinfo = pathinfo($path);

        $parentDir = ($pathinfo['dirname'] != '.') ? $pathinfo['dirname'] : '';
        $url = self::BASE_URI.$this->getFolderUrl($parentDir).'children';

        $folder = new Folder();
        $folder->name = $pathinfo['basename'];

        return $this->getResponse('POST', $url, json_encode($folder), ['Content-Type' => 'application/json']);
    }
1362012
private static function createIndexFilesToPreventDirectoryListing($path)
    {
        if (!self::isPathWithinTmpFolder($path)) {
            return;
        }
        $filesToCreate = array(
            $path . '/index.htm',
            $path . '/index.php'
        );
        foreach ($filesToCreate as $file) {
            @file_put_contents($file, 'Nothing to see here.');
        }
    }
704911
def chmod(path, mode=None, user=None, group=None, other=None, recursive=False):
    
    successful = True
    mode = _ops_mode(mode)
    if user is not None:
        mode.user = user
    if group is not None:
        mode.group = group
    if other is not None:
        mode.other = other
    if recursive:
        for p in find(path, no_peek=True):
            successful = _chmod(p, mode) and successful
    else:
        successful = _chmod(path, mode)
    return successful
766834
protected static function chmodPathRecursive($path, $dirMode, $fileMode)
    {
        $result = false;

        $dirMode = self::valueToOct($dirMode);
        $fileMode = self::valueToOct($fileMode);

        $finder = new Finder();
        // Folders first
        foreach ($finder->directories()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $dirMode);
        }
        // Files next
        foreach ($finder->files()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $fileMode);
        }

        return $result;
    }
926435
public static function createFileDir($path)
    {
        if (!file_exists($path)) {
            self::createFileDir(dirname($path));
            mkdir($path, 0777);
        }
    }
421719
public function makeDir(string $path, bool $force = false) : bool
    {
        if (is_dir($path) == true) {
            return true;
        }

        $result = false;

        try {
            $result = mkdir($path, 0755, $force);
        } catch(\ErrorException $e) {
            $this->addErrorMessage( $e->getMessage() );
        }

        return $result;
    }
1314018
private function createDir($path) {
        $dir = $path;
        if (!is_dir($dir)) {
            $old = umask(0);
            mkdir($dir,0777,true);
            umask($old);
            chmod($dir, 0777);
        }
        return $dir;
    }
822278
public function createFolder(String $path, Int $mode = 0777, Bool $recursive = true) : Bool
    {
        if( @ssh2_sftp_mkdir($this->connect, $path, $mode, $recursive) )
        {
            return true;
        }
        else
        {
            throw new FolderAllreadyException(NULL, $path);
        }
    }