Function: tramp-adb-handle-set-file-times
tramp-adb-handle-set-file-times is a byte-compiled function defined in
tramp-adb.el.gz.
Signature
(tramp-adb-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-adb.el.gz
(defun tramp-adb-handle-set-file-times (filename &optional time flag)
"Like `set-file-times' for Tramp files."
(with-parsed-tramp-file-name filename nil
(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))
(nofollow (if (eq flag 'nofollow) "-h" ""))
(quoted-name (tramp-shell-quote-argument localname)))
;; Older versions of toybox 'touch' mishandle nanoseconds and/or
;; trailing "Z", so fall back on plain seconds if nanoseconds+Z
;; fails. Also, fall back on old POSIX 'touch -t' if 'touch -d'
;; (introduced in POSIX.1-2008) fails.
(tramp-adb-send-command-and-check
v (format
(concat "touch -d %s %s %s 2>%s || "
"touch -d %s %s %s 2>%s || "
"touch -t %s %s %s")
(format-time-string "%Y-%m-%dT%H:%M:%S.%NZ" time t)
nofollow quoted-name (tramp-get-remote-null-device v)
(format-time-string "%Y-%m-%dT%H:%M:%S" time t)
nofollow quoted-name (tramp-get-remote-null-device v)
(format-time-string "%Y%m%d%H%M.%S" time t)
nofollow quoted-name)))))