Function: tramp-get-remote-df

tramp-get-remote-df is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-get-remote-df VEC)

Documentation

Determine remote df command.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-get-remote-df (vec)
  "Determine remote `df' command."
  (with-tramp-connection-property vec "df"
    (tramp-message vec 5 "Finding a suitable `df' command")
    (let ((df (tramp-find-executable vec "df" (tramp-get-remote-path vec)))
	  result)
      (when df
	(cond
	 ;; coreutils.
	 ((tramp-send-command-and-check
	   vec
	   (format
	    "%s /"
	    (setq result
		  (format "%s --block-size=1 --output=size,used,avail" df))))
	  (tramp-set-connection-property vec "df-blocksize" 1)
	  result)
	 ;; POSIX.1
	 ((tramp-send-command-and-check
	   vec (format "%s /" (setq result (format "%s -k" df))))
	  (tramp-set-connection-property vec "df-blocksize" 1024)
	  result))))))