Creates a directory using Drupal's default mode.
PHP's mkdir() does not respect Drupal's default permissions mode. If a mode is not provided, this function will make sure that Drupal's is used.
Compatibility: normal paths and stream wrappers.
$uri: A URI or pathname.
$mode: By default the Drupal mode is used.
$recursive: Default to FALSE.
$context: Refer to http://php.net/manual/ref.stream.php
Boolean TRUE on success, or FALSE on failure.
mkdir()
function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
if (!isset($mode)) {
$mode = variable_get('file_chmod_directory', 0775);
}
if (!isset($context)) {
return mkdir($uri, $mode, $recursive);
}
else {
return mkdir($uri, $mode, $recursive, $context);
}
}