Function: tramp-make-copy-file-name
tramp-make-copy-file-name is a byte-compiled function defined in
tramp-sh.el.gz.
Signature
(tramp-make-copy-file-name VEC)
Documentation
Create a file name suitable for out-of-band methods.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-make-copy-file-name (vec)
"Create a file name suitable for out-of-band methods."
(let ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
(host (tramp-file-name-host vec))
(localname
(directory-file-name (tramp-file-name-unquote-localname vec))))
(when (string-match-p tramp-ipv6-regexp host)
(setq host (format "[%s]" host)))
;; This does not work for MS Windows scp, if there are characters
;; to be quoted. OpenSSH 8 supports disabling of strict file name
;; checking in scp, we use it when available.
(unless (string-match-p (rx (| "dockercp" "podmancp" "ftp") eos) method)
(setq localname (tramp-unquote-shell-quote-argument localname)))
(string-join
(apply #'tramp-expand-args vec
'tramp-copy-file-name tramp-default-copy-file-name
(list ?h (or host "") ?u (or user "") ?f localname))
"")))