function drupal_install_mkdir

7.x install.inc drupal_install_mkdir($file, $mask, $message = TRUE)
6.x install.inc drupal_install_mkdir($file, $mask, $message = TRUE)

Create a directory with specified permissions.

Parameters

file: The name of the directory to create;

mask: The permissions of the directory to create.

$message: (optional) Whether to output messages. Defaults to TRUE.

Return value

TRUE/FALSE whether or not the directory was successfully created.

1 call to drupal_install_mkdir()
drupal_verify_install_file in drupal-6.x/includes/install.inc
Verify the state of the specified file.

File

drupal-6.x/includes/install.inc, line 502

Code

function drupal_install_mkdir($file, $mask, $message = TRUE) {
  $mod = 0;
  $masks = array(FILE_READABLE, FILE_WRITABLE, FILE_EXECUTABLE, FILE_NOT_READABLE, FILE_NOT_WRITABLE, FILE_NOT_EXECUTABLE);
  foreach ($masks as $m) {
    if ($mask & $m) {
      switch ($m) {
        case FILE_READABLE:
          $mod += 444;
          break;
        case FILE_WRITABLE:
          $mod += 222;
          break;
        case FILE_EXECUTABLE:
          $mod += 111;
          break;
      }
    }
  }

  if (@mkdir($file, intval("0$mod", 8))) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}