Function: tramp-adb-do-ls

tramp-adb-do-ls is a byte-compiled function defined in tramp-adb.el.gz.

Signature

(tramp-adb-do-ls VEC SWITCHES &rest FILENAMES)

Documentation

Call "ls" on a remote adb device with SWITCHES.

Return non-il if the call was successful. Ignore return code 1 stderr output.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-adb.el.gz
;; "ls" returns exit code 1 for permission problems and alike.  Ignore
;; those messages.  (Bug#80054)
(defun tramp-adb-do-ls (vec switches &rest filenames)
  "Call \"ls\" on a remote adb device with SWITCHES.
Return non-il if the call was successful.  Ignore return code 1 stderr
output."
  (ignore-errors
    (and-let*
	((ret (tramp-adb-send-command-and-check
	       vec (format
		    "(%s %s %s 2>%s; echo tramp_exit_status $?) | cat"
		    (tramp-adb-get-ls-command vec) switches
		    (mapconcat #'tramp-shell-quote-argument filenames " ")
		    (tramp-get-remote-null-device vec))
	       t t))
	 ((natnump ret))
	 ((<= ret 1))))))