8 file.inc drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL)
7 file.inc drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL)

Creates a directory, optionally creating missing components in the path to the directory.


in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystem::mkdir().

Related topics

8 calls to drupal_mkdir()
Connection::createDatabase in core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
Overrides \Drupal\Core\Database\Connection::createDatabase().
DirectoryTest::testFileCheckLocalDirectoryHandling in core/modules/system/src/Tests/File/DirectoryTest.php
Test local directory handling functions.
FileTestBase::createDirectory in core/modules/system/src/Tests/File/FileTestBase.php
Create a directory and assert it exists.
LocalStream::mkdir in core/lib/Drupal/Core/StreamWrapper/LocalStream.php
Support for mkdir().
ReadOnlyStreamWrapperTest::testReadOnlyBehavior in core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
Test read-only specific behavior.

... See full list


core/includes/file.inc, line 1075
API for handling file uploads and server file management.


function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
  return \Drupal::service('file_system')->mkdir($uri, $mode, $recursive, $context);