Function: tramp-bundle-read-file-names

tramp-bundle-read-file-names is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-bundle-read-file-names VEC FILES)

Documentation

Read file attributes of FILES and with one command fill the cache.

FILES must be the local names only. The cache attributes to be filled are described in tramp-bundle-read-file-names(var)/tramp-bundle-read-file-names(fun).

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-bundle-read-file-names (vec files)
  "Read file attributes of FILES and with one command fill the cache.
FILES must be the local names only.  The cache attributes to be
filled are described in `tramp-bundle-read-file-names'."
  (when files
    (tramp-maybe-send-script
     vec tramp-bundle-read-file-names "tramp_bundle_read_file_names")

    (dolist
	(elt
	 (with-current-buffer (tramp-get-connection-buffer vec)
	   ;; We cannot use `tramp-send-command-and-read', because
	   ;; this does not cooperate well with heredoc documents.
	   (unless (tramp-send-command-and-check
		    vec
		    (format
		     "tramp_bundle_read_file_names <<'%s'\n%s\n%s\n"
		     tramp-end-of-heredoc
		     (mapconcat #'tramp-shell-quote-argument files "\n")
		     tramp-end-of-heredoc))
	     (tramp-error vec 'file-error "%s" (tramp-get-buffer-string)))
	   ;; Read the expression.
	   (goto-char (point-min))
	   (read (current-buffer))))

      (tramp-set-file-property vec (car elt) "file-exists-p" (nth 1 elt))
      (tramp-set-file-property vec (car elt) "file-readable-p" (nth 2 elt))
      (tramp-set-file-property vec (car elt) "file-directory-p" (nth 3 elt)))))