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.

3 calls to drush_register_file_for_deletion()
drush_save_data_to_temp_file in includes/drush.inc
Save a string to a temporary file. Does not depend on Drupal's API. The temporary file will be automatically deleted when drush exits.
drush_tempnam in includes/drush.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_delete_registered_files in includes/drush.inc
Delete all of the registered temporary files.

File

includes/drush.inc, line 466
The drush API implementation and helpers.

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;
}