Function: tramp-file-local-name
tramp-file-local-name is an autoloaded and byte-compiled function
defined in tramp.el.gz.
Signature
(tramp-file-local-name NAME)
Documentation
Return the local name component of NAME.
This function removes from NAME the specification of the remote host and
the method of accessing the host, leaving only the part that identifies
NAME locally on the remote system. If NAME does not match
tramp-file-name-regexp, just file-local-name is called. The
returned file name can be used directly as argument of make-process,
process-file, start-file-process, or shell-command.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
;; This function bypasses the file name handler approach. It is NOT
;; recommended to use it in any package if not absolutely necessary.
;; However, it is more performant than `file-local-name', and might be
;; useful where performance matters, like in operations over a bulk
;; list of file names.
;;;###tramp-autoload
(defun tramp-file-local-name (name)
"Return the local name component of NAME.
This function removes from NAME the specification of the remote host and
the method of accessing the host, leaving only the part that identifies
NAME locally on the remote system. If NAME does not match
`tramp-file-name-regexp', just `file-local-name' is called. The
returned file name can be used directly as argument of `make-process',
`process-file', `start-file-process', or `shell-command'."
(or (and (tramp-tramp-file-p name)
(string-match (nth 0 tramp-file-name-structure) name)
(match-string (nth 4 tramp-file-name-structure) name))
(file-local-name name)))