function _drush_recursive_copy

8.0.x filesystem.inc _drush_recursive_copy($src, $dest)
6.x filesystem.inc _drush_recursive_copy($src, $dest)
7.x filesystem.inc _drush_recursive_copy($src, $dest)
4.x drush.inc _drush_recursive_copy($src, $dest)
5.x filesystem.inc _drush_recursive_copy($src, $dest)
master filesystem.inc _drush_recursive_copy($src, $dest)

Internal function called by drush_copy_dir; do not use directly.

Related topics

1 string reference to '_drush_recursive_copy'
drush_copy_dir in includes/drush.inc
Copy $src to $dest.

File

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

Code

function _drush_recursive_copy($src, $dest) {
  // all subdirectories and contents:
  if (is_dir($src)) {
    drush_mkdir($dest);
    $dir_handle = opendir($src);
    while ($file = readdir($dir_handle)) {
      if ($file != "." && $file != "..") {
        if (_drush_recursive_copy("$src/$file", "$dest/$file") !== TRUE) {
          return FALSE;
        }
      }
    }
    closedir($dir_handle);
  }
  elseif (drush_op('copy', $src, $dest) !== TRUE) {
    return FALSE;
  }

  // Preserve permissions
  if (!drush_is_windows()) {
    chmod($dest, intval(fileperms($src), 8));
  }

  return TRUE;
}