Function: tramp-call-process

tramp-call-process is a byte-compiled function defined in tramp.el.gz.

Signature

(tramp-call-process VEC PROGRAM &optional INFILE DESTINATION DISPLAY &rest ARGS)

Documentation

Call call-process on the local host.

It always returns a return code. The Lisp error raised when PROGRAM is nil is trapped also, returning 1. Furthermore, traces are written with verbosity of 6.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
;;; Compatibility functions section:

(defun tramp-call-process
  (vec program &optional infile destination display &rest args)
  "Call `call-process' on the local host.
It always returns a return code.  The Lisp error raised when
PROGRAM is nil is trapped also, returning 1.  Furthermore, traces
are written with verbosity of 6."
  (let ((default-directory tramp-compat-temporary-file-directory)
	(process-environment (default-toplevel-value 'process-environment))
	(destination (if (eq destination t) (current-buffer) destination))
	(vec (or vec (car tramp-current-connection)))
	output error result)
    (tramp-message
     vec 6 "`%s %s' %s %s"
     program (string-join args " ") infile destination)
    (condition-case err
	(with-temp-buffer
	  (setq result
		(apply
		 #'call-process program infile (or destination t) display args))
	  ;; `result' could also be an error string.
	  (when (stringp result)
	    (setq error result
		  result 1))
	  (with-current-buffer
	      (if (bufferp destination) destination (current-buffer))
	    (setq output (buffer-string))))
      (error
       (setq error (error-message-string err)
	     result 1)))
    (if (zerop (length error))
	(tramp-message vec 6 "%s\n%s" result output)
      (tramp-message vec 6 "%s\n%s\n%s" result output error))
    result))