Function: tramp-sh-handle-file-exists-p

tramp-sh-handle-file-exists-p is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-sh-handle-file-exists-p FILENAME)

Documentation

Like file-exists-p for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
;; Basic functions.

(defun tramp-sh-handle-file-exists-p (filename)
  "Like `file-exists-p' for Tramp files."
  ;; `file-exists-p' is used as predicate in file name completion.
  ;; We don't want to run it when `non-essential' is t, or there is
  ;; no connection process yet.
  (when (tramp-connectable-p filename)
    (with-parsed-tramp-file-name filename nil
      (with-tramp-file-property v localname "file-exists-p"
	(or (not (null (tramp-get-file-property
			v localname "file-attributes-integer" nil)))
            (not (null (tramp-get-file-property
			v localname "file-attributes-string" nil)))
	    (tramp-send-command-and-check
	     v
	     (format
	      "%s %s"
	      (tramp-get-file-exists-command v)
	      (tramp-shell-quote-argument localname))))))))