Function: dired-copy-file-recursive

dired-copy-file-recursive is a byte-compiled function defined in dired-aux.el.gz.

Signature

(dired-copy-file-recursive FROM TO OK-FLAG &optional PRESERVE-TIME TOP RECURSIVE DEREFERENCE)

Source Code

;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
(defun dired-copy-file-recursive (from to ok-flag &optional
                                       preserve-time top recursive
                                       dereference)
  (when (and (eq t (file-attribute-type (file-attributes from)))
	     (file-in-directory-p to from))
    (error "Cannot copy `%s' into its subdirectory `%s'" from to))
  (let ((attrs (file-attributes from)))
    (if (and recursive
	     (eq t (file-attribute-type attrs))
	     (or (eq recursive 'always)
		 (yes-or-no-p (format "Copy %s recursively? " from))))
	(copy-directory from to preserve-time)
      (or top (dired-handle-overwrite to))
      (condition-case err
	  (if (and (not dereference)
                   (stringp (file-attribute-type attrs)))
	      ;; It is a symlink
	      (make-symbolic-link (file-attribute-type attrs) to ok-flag)
            (dired-maybe-create-dirs (file-name-directory to))
	    (copy-file from to ok-flag preserve-time))
	(file-date-error
	 (push (dired-make-relative from)
	       dired-create-files-failures)
	 (dired-log "Can't set date on %s:\n%s\n" from err))))))