Function: tramp-equal-remote
tramp-equal-remote is a byte-compiled function defined in tramp.el.gz.
Signature
(tramp-equal-remote FILE1 FILE2)
Documentation
Check, whether the remote parts of FILE1 and FILE2 are identical.
The check depends on method, user and host name of the files. If one of the components is missing, the default values are used. The local file name parts of FILE1 and FILE2 are not taken into account.
Example:
(tramp-equal-remote "/ssh::/etc" "/-:<your host name>:/home")
would yield t. On the other hand, the following check results in nil:
(tramp-equal-remote "/sudo::/etc" "/su::/etc")
If both files are local, the function returns t.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
;; Comparison of vectors is performed by `tramp-file-name-equal-p'.
(defun tramp-equal-remote (file1 file2)
"Check, whether the remote parts of FILE1 and FILE2 are identical.
The check depends on method, user and host name of the files. If
one of the components is missing, the default values are used.
The local file name parts of FILE1 and FILE2 are not taken into
account.
Example:
(tramp-equal-remote \"/ssh::/etc\" \"/-:<your host name>:/home\")
would yield t. On the other hand, the following check results in nil:
(tramp-equal-remote \"/sudo::/etc\" \"/su::/etc\")
If both files are local, the function returns t."
(or (and (null (tramp-tramp-file-p file1)) (null (tramp-tramp-file-p file2)))
(and (tramp-tramp-file-p file1) (tramp-tramp-file-p file2)
(string-equal (file-remote-p file1) (file-remote-p file2)))))