function drush_tempdir

8.0.x filesystem.inc drush_tempdir()
6.x filesystem.inc drush_tempdir()
7.x filesystem.inc drush_tempdir()
4.x drush.inc drush_tempdir()
5.x filesystem.inc drush_tempdir()
master filesystem.inc drush_tempdir()

Creates a temporary directory and return its path.

Related topics

10 calls to drush_tempdir()
drush_archive_dump in commands/core/archive.drush.inc
Command callback. Generate site archive file.
drush_archive_restore in commands/core/archive.drush.inc
Command callback. Restore web site(s) from a site archive file.
drush_config_edit in commands/core/config.drush.inc
Edit command callback.
drush_config_import in commands/core/config.drush.inc
Command callback. Import from specified config directory (defaults to sync).
make_download_bzr in commands/make/make.download.inc
Checks out a Bazaar repository to the specified download location.

... See full list

File

includes/filesystem.inc, line 513
Filesystem utilities.

Code

function drush_tempdir() {
  $tmp_dir = drush_trim_path(drush_find_tmp());
  $tmp_dir .= '/' . 'drush_tmp_' . uniqid(time() . '_');

  drush_mkdir($tmp_dir);
  drush_register_file_for_deletion($tmp_dir);

  return $tmp_dir;
}