Function: tramp-adb-handle-directory-files-and-attributes

tramp-adb-handle-directory-files-and-attributes is a byte-compiled function defined in tramp-adb.el.gz.

Signature

(tramp-adb-handle-directory-files-and-attributes DIRECTORY &optional FULL MATCH NOSORT ID-FORMAT COUNT)

Documentation

Like directory-files-and-attributes for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-adb.el.gz
(defun tramp-adb-handle-directory-files-and-attributes
  (directory &optional full match nosort id-format count)
  "Like `directory-files-and-attributes' for Tramp files."
  (tramp-skeleton-directory-files-and-attributes
      directory full match nosort id-format count
    (with-current-buffer (tramp-get-buffer v)
      (when (tramp-adb-send-command-and-check
	     v (format "(%s -a -l %s; echo tramp_exit_status $?) | cat"
		       (tramp-adb-get-ls-command v)
		       (tramp-shell-quote-argument localname))
             nil t)
	;; We insert also filename/. and filename/.., because "ls"
	;; doesn't on some file systems, like "sdcard".
	(unless (search-backward-regexp (rx "." eol) nil t)
	  (narrow-to-region (point-max) (point-max))
	  (tramp-adb-send-command
	   v (format "%s -d -a -l %s %s | cat"
		     (tramp-adb-get-ls-command v)
		     (tramp-shell-quote-argument
		      (tramp-compat-file-name-concat localname "."))
		     (tramp-shell-quote-argument
		      (tramp-compat-file-name-concat localname ".."))))
	  (tramp-compat-replace-regexp-in-region
	   (rx (literal (file-name-unquote (file-name-as-directory localname))))
	   "" (point-min))
	  (widen)))
      (tramp-adb-sh-fix-ls-output)
      (tramp-do-parse-file-attributes-with-ls v))))