1 file.inc backdrop_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL)

Creates a directory using Backdrop's default mode.

PHP's mkdir() does not respect Backdrop's default permissions mode. If a mode is not provided, this function will make sure that Backdrop's is used.

Compatibility: normal paths and stream wrappers.

Parameters

$uri: A URI or pathname.

$mode: By default the Backdrop mode is used.

$recursive: Default to FALSE.

$context: Refer to http://php.net/manual/ref.stream.php

Return value

Boolean TRUE on success, or FALSE on failure.

See also

mkdir()

http://drupal.org/node/515192

Related topics

File

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

Code

function backdrop_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
  if (!isset($mode)) {
    $mode = settings_get('file_chmod_directory', 0775);
  }

  if (!isset($context)) {
    return mkdir($uri, $mode, $recursive);
  }
  else {
    return mkdir($uri, $mode, $recursive, $context);
  }
}