Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Filesystem.php

function Filesystem::mkdir

Same name in this branch
  1. 11.1.x vendor/php-tuf/composer-stager/src/Internal/Filesystem/Service/Filesystem.php \PhpTuf\ComposerStager\Internal\Filesystem\Service\Filesystem::mkdir()
  2. 11.1.x core/lib/Drupal/Core/File/FileSystem.php \Drupal\Core\File\FileSystem::mkdir()

Creates a directory recursively.

Throws

IOException On any directory creation failure

5 calls to Filesystem::mkdir()
Filesystem::appendToFile in vendor/symfony/filesystem/Filesystem.php
Appends content to an existing file.
Filesystem::copy in vendor/symfony/filesystem/Filesystem.php
Copies a file.
Filesystem::dumpFile in vendor/symfony/filesystem/Filesystem.php
Atomically dumps content into a file.
Filesystem::mirror in vendor/symfony/filesystem/Filesystem.php
Mirrors a directory to another.
Filesystem::symlink in vendor/symfony/filesystem/Filesystem.php
Creates a symbolic link or copy a directory.

File

vendor/symfony/filesystem/Filesystem.php, line 90

Class

Filesystem
Provides basic utility to manipulate the file system.

Namespace

Symfony\Component\Filesystem

Code

public function mkdir(string|iterable $dirs, int $mode = 0777) : void {
    foreach ($this->toIterable($dirs) as $dir) {
        if (is_dir($dir)) {
            continue;
        }
        if (!self::box('mkdir', $dir, $mode, true) && !is_dir($dir)) {
            throw new IOException(\sprintf('Failed to create "%s": ', $dir) . self::$lastError, 0, null, $dir);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal