Creates a directory.

This method creates directories recursively.
@param ConsoleIo $io The console io
@param string $path Directory path
@return bool
@uses folderChmod()
@uses verboseIfFileExists()
514750
public function createDir(ConsoleIo $io, $path)
    {
        if ($this->verboseIfFileExists($io, $path)) {
            return false;
        }

        if (!@mkdir($path, 0777, true)) {
            $io->error(__d('me_tools', 'Failed to create file or directory `{0}`', rtr($path)));

            return false;
        }

        $io->verbose(__d('me_tools', 'Created `{0}` directory', rtr($path)));
        $this->folderChmod($io, $path);

        return true;
    }
762782
public static function create($path = null, $mode = self::DEFAULT_UNIX_CHMOD_DIRECTORIES, $recursive = true)
    {
        if (is_null($path)) {
            return null;
        }
        return mkdir($path, Filesystem::getOctal($mode), $recursive);
    }
84454
protected function createDirectory($type)
    {
        if(is_array($directories = $this->getDirOption(true))) {
            $function = 'get' . ucfirst($type) . 'Directory';
            $directory_array = [];
            $directory_paths = [];
            if($directories) {
                foreach($directories as $directory) {
                    array_push($directory_array, $directory);
                    array_push($directory_paths, implode('/', $directory_array));
                    if($directory_paths) {
                        foreach($directory_paths as $directory_path) {
                            if( ! $this->files->isDirectory($this->{$function}() . $directory_path)) {
                                $this->files->makeDirectory($this->{$function}() . $directory_path);
                            }
                        }
                    }
                }
            }
        }
    }
876344
def make_directory(path):
        
        try:
            makedirs(path)
            logging.debug('Directory created: {0}'.format(path))

        except OSError as e:
            if e.errno != errno.EEXIST:
                raise
342302
public static function create($path, $chmod = 0755)
    {
        $path = Normalize::diskFullPath($path);

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

        return @mkdir($path, $chmod, true);
    }
667043
public function execute(Arguments $args, ConsoleIo $io)
    {
        $path = $args->getOption('path') ?: Folder::slashTerm(ROOT) . 'composer.json';

        try {
            is_writable_or_fail($path);
        } catch (Exception $e) {
            $io->err($e->getMessage());
            $this->abort();
        }

        //Gets and decodes the file
        $contents = json_decode(file_get_contents($path), true);

        if (empty($contents)) {
            $io->err(__d('me_tools', 'The file {0} does not seem a valid {1} file', rtr($path), 'composer.json'));
            $this->abort();
        }

        //Checks if the file has been fixed
        if (empty($contents['config']['component-dir']) || $contents['config']['component-dir'] !== 'vendor/components') {
            $contents += ['config' => ['component-dir' => 'vendor/components']];
            create_file($path, json_encode($contents, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
            $io->verbose(__d('me_tools', 'The file {0} has been fixed', rtr($path)));
        } else {
            $io->verbose(__d('me_tools', 'The file {0} doesn\'t need to be fixed', rtr($path)));
        }

        return null;
    }
816436
public static function createFolder($path)
    {
        if (!file_exists($path)) {
            self::createFolder(dirname($path));
            mkdir($path, 0777);
        }
    }
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
                )
            );
        }
    }
1123616
public function openDir()
   {
        if(!$this->isDir())
        {
            throw new IOException("Not a directory");
        }

        $dirconv = DirectoryConverter::fromPath($this);
        $dirconv->setRoot($this->getRootDirectory());

        $type = $this->getDirectoryType();
        return new $type($dirconv);
   }
606279
public function makeDir( $path )
    {
        if ( null === $this->identity )
        {
            return false;
        }

        if ( is_array( $path ) || is_object( $path ) )
        {
            $result = array();

            foreach ( $path as $key => $p )
            {
                $result[$key] = $this->makeDir( $p );
            }

            return $result;
        }

        $path = $this->realPath( $path );
        return $this->createDir( $path );
    }
318710
public function createDirectory($path, $recursive = false, $mode = null)
    {
        return $this->container()->createDir($path, $recursive, $mode);
    }
1157703
public static function mkdir($path, $mode, $cb = null, $pri = EIO_PRI_DEFAULT)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (!FileSystem::$supported) {
            $r = mkdir($path, $mode);
            if ($cb) {
                $cb($path, $r);
            }
            return $r;
        }
        return eio_mkdir($path, $mode, $pri, $cb, $path);
    }
720485
private static void createDirectory(Path path) throws IOException {
		try {
			Files.createDirectory(path);
		} catch (FileAlreadyExistsException e) {
			if (!Files.isDirectory(path)) {
				throw e;
			}
		}
	}
392665
static public void recursiveCreateDirectory(FTPClient ftpClient, String path) throws IOException {

		logger.info("Create Directory: {}", path);
		int createDirectoryStatus = ftpClient.mkd(path); // makeDirectory...
		logger.debug("Create Directory Status: {}", createDirectoryStatus);
		
		if (createDirectoryStatus == FTP_FILE_NOT_FOUND) {
			int sepIdx = path.lastIndexOf('/');
			if (sepIdx > -1) {
				String parentPath = path.substring(0, sepIdx);
				recursiveCreateDirectory(ftpClient, parentPath);

				logger.debug("2'nd CreateD irectory: {}", path);
				createDirectoryStatus = ftpClient.mkd(path); // makeDirectory...
				logger.debug("2'nd Create Directory Status: {}", createDirectoryStatus);
			}
		}
	}
228505
public static function makeDir($path, $mode = null)
    {
        $mode = $mode ? self::valueToOct($mode) : self::getDefaultDirMode();
        self::mkdir($path, $mode);
        return true;
    }
126111
protected function createDirectory($path)
    {
        if (!File::isDirectory($path)) {
            File::makeDirectory($path, 0777, true, true);
        }

        return $this;
    }
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;
    }