1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Improve use of "touch" in Tramp

* lisp/net/tramp-sh.el (tramp-get-remote-touch): Set connection
property "touch-h".
(tramp-sh-handle-set-file-times): Use it.
This commit is contained in:
Toru TSUNEYOSHI 2025-08-16 12:56:09 +02:00 committed by Michael Albinus
parent 4a3b6daf76
commit 6a018a2d7e

View file

@ -1601,7 +1601,10 @@ of."
"-t %s" "-t %s"
(format-time-string "%Y%m%d%H%M.%S" (tramp-defined-time time) t)) (format-time-string "%Y%m%d%H%M.%S" (tramp-defined-time time) t))
"") "")
(if (eq flag 'nofollow) "-h" "") (if (and (eq flag 'nofollow)
(tramp-get-connection-property v "touch-h"))
"-h"
"")
(tramp-shell-quote-argument localname)))))) (tramp-shell-quote-argument localname))))))
(defun tramp-sh-handle-get-home-directory (vec &optional user) (defun tramp-sh-handle-get-home-directory (vec &optional user)
@ -5892,6 +5895,14 @@ Nonexistent directories are removed from spec."
result result
(format-time-string "%Y%m%d%H%M.%S") (format-time-string "%Y%m%d%H%M.%S")
(tramp-file-local-name tmpfile)))) (tramp-file-local-name tmpfile))))
(tramp-set-connection-property
vec "touch-h"
(tramp-send-command-and-check
vec
(format
"%s -h %s"
result
(tramp-file-local-name tmpfile))))
(delete-file tmpfile)) (delete-file tmpfile))
result))) result)))