Filesystem convenience functions.

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


Namesort descending Location Description
drush_copy_dir drush/includes/ Copy $src to $dest.
drush_correct_absolute_path_for_exec drush/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_delete_dir drush/includes/ Deletes the specified file or directory and everything inside it.
drush_delete_dir_contents drush/includes/ Deletes the contents of a directory.
drush_delete_tmp_dir drush/includes/ Deletes the provided file or folder and everything inside it. This function explicitely tries to delete read-only files / folders.
drush_dir_md5 drush/includes/ Calculates a single md5 hash for all files a directory (incuding subdirectories)
drush_file_append_data drush/includes/ Simple helper function to append data to a given file.
drush_file_not_empty drush/includes/ Test to see if a file exists and is not empty
drush_find_tmp drush/includes/ Returns the path to a temporary directory.
drush_is_absolute_path drush/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_mkdir drush/includes/ Cross-platform compatible helper function to recursively create a directory tree.
drush_move_dir drush/includes/ Move $src to $dest.
drush_normalize_path drush/includes/ Makes sure the path has only path separators native for the current operating system
drush_preflight_backup_dir drush/includes/ Decide where our backup directory should go
drush_prepare_backup_dir drush/includes/ Prepare a backup directory
drush_register_file_for_deletion drush/includes/ Any file passed in to this function will be deleted when drush exits.
drush_save_data_to_temp_file drush/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_scan_directory drush/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_tempdir drush/includes/ Creates a temporary directory and return its path.
drush_tempnam drush/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_trim_path drush/includes/ Remove the trailing DIRECTORY_SEPARATOR from a path. Will actually remove either / or \ on Windows.
_drush_delete_registered_files drush/includes/ Delete all of the registered temporary files.
_drush_recursive_copy drush/includes/ Internal function called by drush_copy_dir; do not use directly.


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


drush/includes/, line 8
Filesystem utilities.