Filesystem convenience functions.

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

Functions

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

Constants

Name Locationsort descending Description
FILE_EXISTS_ABORT includes/filesystem.inc Behavior for drush_copy_dir() and drush_move_dir() when destinations exist.
FILE_EXISTS_OVERWRITE includes/filesystem.inc
FILE_EXISTS_MERGE includes/filesystem.inc

File

includes/filesystem.inc, line 8
Filesystem utilities.