Filesystem convenience functions.

  1. 8.0.x includes/ filesystemfunctions
  2. 6.x includes/ filesystemfunctions
  3. 7.x includes/ filesystemfunctions
  4. 4.x includes/ filesystemfunctions
  5. 5.x includes/ filesystemfunctions
  6. master includes/ filesystemfunctions


Namesort ascending Location Description
_drush_recursive_copy includes/ Internal function called by drush_copy_dir; do not use directly.
_drush_delete_registered_files includes/ Delete all of the registered temporary files.
drush_trim_path includes/ Remove the trailing DIRECTORY_SEPARATOR from a path. Will actually remove either / or \ on Windows.
drush_tempnam includes/ 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_tempdir includes/ Creates a temporary directory and return its path.
drush_scan_directory includes/ Finds all files that match a given mask in a given directory. Directories and files beginning with a period are excluded; this prevents hidden files and directories (such as SVN working directories and GIT repositories) from being scanned.
drush_save_data_to_temp_file includes/ 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_register_file_for_deletion includes/ Any file passed in to this function will be deleted when drush exits.
drush_program_exists includes/
drush_prepare_backup_dir includes/ Prepare a backup directory
drush_preflight_backup_dir includes/ Decide where our backup directory should go
drush_normalize_path includes/ Makes sure the path has only path separators native for the current operating system
drush_move_dir includes/ Move $src to $dest.
drush_mkdir includes/ Cross-platform compatible helper function to recursively create a directory tree.
drush_is_nested_directory includes/ Return 'TRUE' if one directory is located anywhere inside the other.
drush_is_absolute_path includes/ Determines whether the provided path is absolute or not on the specified O.S. -- starts with "/" on *nix, or starts with "[A-Z]:\" or "[A-Z]:/" on Windows.
drush_find_tmp includes/ Returns the path to a temporary directory.
drush_file_not_empty includes/ Test to see if a file exists and is not empty
drush_file_append_data includes/ Simple helper function to append data to a given file.
drush_dir_md5 includes/ Calculates a single md5 hash for all files a directory (incuding subdirectories)
drush_delete_tmp_dir includes/ Deletes the provided file or folder and everything inside it. This function explicitely tries to delete read-only files / folders.
drush_delete_dir_contents includes/ Deletes the contents of a directory.
drush_delete_dir includes/ Deletes the specified file or directory and everything inside it.
drush_correct_absolute_path_for_exec includes/ If we are going to pass a path to exec or proc_open, then we need to fix it up under CYGWIN or MINGW. In both of these environments, PHP works with absolute paths such as "C:\path". CYGWIN expects these to be converted to…
drush_copy_dir includes/ Copy $src to $dest.


Namesort ascending Location Description
FILE_EXISTS_ABORT includes/ Behavior for drush_copy_dir() and drush_move_dir() when destinations exist.


includes/, line 8
Filesystem utilities.