Function: tramp-get-ls-command-with

tramp-get-ls-command-with is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-get-ls-command-with VEC OPTION)

Documentation

Return OPTION, if the remote ls command supports the OPTION option.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-get-ls-command-with (vec option)
  "Return OPTION, if the remote `ls' command supports the OPTION option."
  (with-tramp-connection-property vec (concat "ls" option)
    (tramp-message vec 5 "Checking, whether `ls %s' works" option)
    ;; Some "ls" versions are sensitive to the order of arguments,
    ;; they fail when "-al" is after the "--dired" argument (for
    ;; example on FreeBSD).  Busybox does not support this kind of
    ;; options.
    (and
     (not
      (tramp-send-command-and-check
       vec
       (format
	"%s --help 2>&1 | grep -iq busybox" (tramp-get-ls-command vec))))
     (tramp-send-command-and-check
      vec (format
           "%s %s -al %s"
           (tramp-get-ls-command vec) option (tramp-get-remote-null-device vec)))
     option)))