'((access-file . tramp-handle-access-file)
(add-name-to-file . tramp-handle-add-name-to-file)
;; `byte-compiler-base-file-name' performed by default handler.
- ;; `copy-directory' performed by default handler.
+ (copy-directory . tramp-handle-copy-directory)
(copy-file . tramp-adb-handle-copy-file)
(delete-directory . tramp-adb-handle-delete-directory)
(delete-file . tramp-adb-handle-delete-file)
'((access-file . tramp-handle-access-file)
(add-name-to-file . tramp-handle-add-name-to-file)
;; `byte-compiler-base-file-name' performed by default handler.
- ;; `copy-directory' performed by default handler.
+ (copy-directory . tramp-handle-copy-directory)
(copy-file . tramp-gvfs-handle-copy-file)
(delete-directory . tramp-gvfs-handle-delete-directory)
(delete-file . tramp-gvfs-handle-delete-file)
'((access-file . tramp-handle-access-file)
(add-name-to-file . tramp-handle-add-name-to-file)
;; `byte-compiler-base-file-name' performed by default handler.
- ;; `copy-directory' performed by default handler.
+ (copy-directory . tramp-handle-copy-directory)
(copy-file . tramp-rclone-handle-copy-file)
(delete-directory . tramp-rclone-handle-delete-directory)
(delete-file . tramp-rclone-handle-delete-file)
'((access-file . tramp-handle-access-file)
(add-name-to-file . tramp-sudoedit-handle-add-name-to-file)
(byte-compiler-base-file-name . ignore)
- ;; `copy-directory' performed by default handler.
+ (copy-directory . tramp-handle-copy-directory)
(copy-file . tramp-sudoedit-handle-copy-file)
(delete-directory . tramp-sudoedit-handle-delete-directory)
(delete-file . tramp-sudoedit-handle-delete-file)
filename newname 'ok-if-already-exists 'keep-time
'preserve-uid-gid 'preserve-permissions)))
+(defun tramp-handle-copy-directory
+ (directory newname &optional keep-date parents copy-contents)
+ "Like `copy-directory' for Tramp files."
+ ;; `directory-files' creates `newname' before running this check.
+ ;; So we do it ourselves.
+ (unless (file-exists-p directory)
+ (tramp-error
+ (tramp-dissect-file-name directory) tramp-file-missing
+ "No such file or directory" directory))
+ ;; We must do it file-wise.
+ (tramp-run-real-handler
+ 'copy-directory
+ (list directory newname keep-date parents copy-contents)))
+
(defun tramp-handle-directory-file-name (directory)
"Like `directory-file-name' for Tramp files."
;; If localname component of filename is "/", leave it unchanged.