function drush_register_file_for_deletion

8.0.x filesystem.inc drush_register_file_for_deletion($file = NULL)
6.x filesystem.inc drush_register_file_for_deletion($file = NULL)
7.x filesystem.inc drush_register_file_for_deletion($file = NULL)
3.x drush.inc drush_register_file_for_deletion($file = NULL)
4.x drush.inc drush_register_file_for_deletion($file = NULL)
5.x filesystem.inc drush_register_file_for_deletion($file = NULL)
master filesystem.inc drush_register_file_for_deletion($file = NULL)

Any file passed in to this function will be deleted when drush exits.

Related topics

7 calls to drush_register_file_for_deletion()
drush_download_file in includes/drush.inc
Download a file using wget, curl or file_get_contents, or via download cache.
drush_find_tmp in includes/filesystem.inc
Returns the path to a temporary directory.
drush_tempdir in includes/filesystem.inc
Creates a temporary directory and return its path.
drush_tempnam in includes/filesystem.inc
Creates a temporary file, and registers it so that it will be deleted when drush exits. Whenever possible, drush_save_data_to_temp_file() should be used instead of this function.
drush_xkcd_display in examples/xkcd.drush.inc
Display a given XKCD cartoon.

... See full list

File

includes/filesystem.inc, line 527
Filesystem utilities.

Code

function drush_register_file_for_deletion($file = NULL) {
  static $registered_files = array();

  if (isset($file)) {
    if (empty($registered_files)) {
      register_shutdown_function('_drush_delete_registered_files');
    }
    $registered_files[] = $file;
  }

  return $registered_files;
}