Function: tramp-sh-handle-set-file-times

tramp-sh-handle-set-file-times is a byte-compiled function defined in tramp-sh.el.gz.

Signature

(tramp-sh-handle-set-file-times FILENAME &optional TIME FLAG)

Documentation

Like set-file-times for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-sh.el.gz
(defun tramp-sh-handle-set-file-times (filename &optional time flag)
  "Like `set-file-times' for Tramp files."
  (with-parsed-tramp-file-name filename nil
    (when (tramp-get-remote-touch v)
      (tramp-flush-file-properties v localname)
      (let ((time
	     (if (or (null time)
		     (tramp-compat-time-equal-p time tramp-time-doesnt-exist)
		     (tramp-compat-time-equal-p time tramp-time-dont-know))
		 (current-time)
	       time)))
	(tramp-send-command-and-check
	 v (format
	    "env TZ=UTC %s %s %s %s"
	    (tramp-get-remote-touch v)
	    (if (tramp-get-connection-property v "touch-t" nil)
		(format "-t %s" (format-time-string "%Y%m%d%H%M.%S" time t))
	      "")
	    (if (eq flag 'nofollow) "-h" "")
	    (tramp-shell-quote-argument localname)))))))