Commit d270d7d4 authored by Michael Albinus's avatar Michael Albinus

Improve Tramp's copy-directory

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add `copy-directory'.

* lisp/net/tramp.el (tramp-handle-copy-directory): New defun.
parent 91c732f6
Pipeline #3936 failed with stage
in 56 minutes and 16 seconds
......@@ -94,7 +94,7 @@ It is used for TCP/IP devices."
'((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)
......
......@@ -535,7 +535,7 @@ It has been changed in GVFS 1.14.")
'((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)
......
......@@ -70,7 +70,7 @@
'((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)
......
......@@ -66,7 +66,7 @@ See `tramp-actions-before-shell' for more info.")
'((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)
......
......@@ -3016,6 +3016,20 @@ User is always nil."
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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment