Function: tramp-gvfs-send-command

tramp-gvfs-send-command is a byte-compiled function defined in tramp-gvfs.el.gz.

Signature

(tramp-gvfs-send-command VEC COMMAND &rest ARGS)

Documentation

Send the COMMAND with its ARGS to connection VEC.

COMMAND is a command from the gvfs-* utilities. It is replaced by the corresponding gio tool call if available. call-process is applied, and it returns t if the return code is zero.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-gvfs.el.gz
(defun tramp-gvfs-send-command (vec command &rest args)
  "Send the COMMAND with its ARGS to connection VEC.
COMMAND is a command from the gvfs-* utilities.  It is replaced
by the corresponding gio tool call if available.  `call-process'
is applied, and it returns t if the return code is zero."
  (let ((locale (tramp-get-local-locale vec)))
    (when (tramp-gvfs-gio-tool-p vec)
      ;; Use gio tool.
      (setq args (cons (cdr (assoc command tramp-gvfs-gio-mapping))
		       (delq nil args))
	    command "gio"))

    (with-current-buffer (tramp-get-connection-buffer vec)
      (tramp-gvfs-maybe-open-connection vec)
      (erase-buffer)
      (or (zerop
	   (apply
	    #'tramp-call-process vec "env" nil t nil
	    (append `(,(format "LANG=%s" locale)
		      ,(format "LANGUAGE=%s" locale)
		      ,(format "LC_ALL=%s" locale)
		      ,command)
		    args)))
	  ;; Remove information about mounted connection.
	  (and (tramp-flush-file-properties vec "/") nil)))))