function drush_mkdir

8.0.x drush_mkdir($path, $required = TRUE)
6.x drush_mkdir($path, $required = TRUE)
7.x drush_mkdir($path, $required = TRUE)
4.x drush_mkdir($path)
5.x drush_mkdir($path, $required = TRUE)
master drush_mkdir($path, $required = TRUE)

Cross-platform compatible helper function to recursively create a directory tree.

Related topics

13 calls to drush_mkdir()
drush_archive_dump in commands/core/
Command callback. Generate site archive file.
drush_download_file in includes/
Download a file using wget, curl or file_get_contents, or via download cache.
drush_find_tmp in includes/
Returns the path to a temporary directory.
drush_pm_download_validate in commands/pm/
Implementation of drush_COMMAND_validate().
drush_pm_version_control_backup::pre_update in commands/pm/version_control/
Implementation of pre_update().

... See full list


includes/, line 1771
The drush API implementation and helpers.


function drush_mkdir($path) {
  if (!is_dir($path)) {
    if (drush_mkdir(dirname($path))) {
      if (@mkdir($path)) {
        return TRUE;
      else {
        if (is_writable(dirname($path))) {
          drush_set_error('DRUSH_CREATE_DIR_FAILURE', dt('Unable to create !dir.', array('!dir' => preg_replace('/\w+\/\.\.\//', '', $path))));
        else {
          drush_set_error('DRUSH_DESTINATION_NOT_WRITABLE', dt('Unable to write in !dir. Please check directory permissions.', array('!dir' => realpath(dirname($path)))));
  else {
    return TRUE;