2177 |
(fa2 (file-attributes file2))) |
(fa2 (file-attributes file2))) |
2178 |
(if (and (not (equal (nth 5 fa1) '(0 0))) |
(if (and (not (equal (nth 5 fa1) '(0 0))) |
2179 |
(not (equal (nth 5 fa2) '(0 0)))) |
(not (equal (nth 5 fa2) '(0 0)))) |
2180 |
(> 0 (car (tramp-time-diff (nth 5 fa1) (nth 5 fa2)))) |
(> 0 (tramp-time-diff (nth 5 fa1) (nth 5 fa2))) |
2181 |
;; If one of them is the dont-know value, then we can |
;; If one of them is the dont-know value, then we can |
2182 |
;; still try to run a shell command on the remote host. |
;; still try to run a shell command on the remote host. |
2183 |
;; However, this only works if both files are Tramp |
;; However, this only works if both files are Tramp |
6118 |
NOTE: This function will fail if the time difference is too large to |
NOTE: This function will fail if the time difference is too large to |
6119 |
fit in an integer." |
fit in an integer." |
6120 |
;; Pacify byte-compiler with `symbol-function'. |
;; Pacify byte-compiler with `symbol-function'. |
6121 |
(cond ((fboundp 'subtract-time) |
(cond ((and (fboundp 'subtract-time) |
6122 |
(cadr (funcall (symbol-function 'subtract-time) t1 t2))) |
(fboundp 'float-time)) |
6123 |
|
(funcall (symbol-function 'float-time) |
6124 |
|
(funcall (symbol-function 'subtract-time) t1 t2))) |
6125 |
|
((and (fboundp 'subtract-time) |
6126 |
|
(fboundp 'time-to-seconds)) |
6127 |
|
(funcall (symbol-function 'time-to-seconds) |
6128 |
|
(funcall (symbol-function 'subtract-time) t1 t2))) |
6129 |
((fboundp 'itimer-time-difference) |
((fboundp 'itimer-time-difference) |
6130 |
(floor (funcall |
(floor (funcall |
6131 |
(symbol-function 'itimer-time-difference) |
(symbol-function 'itimer-time-difference) |
6132 |
(if (< (length t1) 3) (append t1 '(0)) t1) |
(if (< (length t1) 3) (append t1 '(0)) t1) |
6133 |
(if (< (length t2) 3) (append t2 '(0)) t2)))) |
(if (< (length t2) 3) (append t2 '(0)) t2)))) |
6134 |
(t |
(t |
6135 |
;; snarfed from Emacs 21 time-date.el |
;; snarfed from Emacs 21 time-date.el; combining |
6136 |
(cadr (let ((borrow (< (cadr t1) (cadr t2)))) |
;; time-to-seconds and subtract-time |
6137 |
|
(let ((time (let ((borrow (< (cadr t1) (cadr t2)))) |
6138 |
(list (- (car t1) (car t2) (if borrow 1 0)) |
(list (- (car t1) (car t2) (if borrow 1 0)) |
6139 |
(- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))))) |
(- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))) |
6140 |
|
(+ (* (car time) 65536.0) |
6141 |
|
(cadr time) |
6142 |
|
(/ (or (nth 2 time) 0) 1000000.0)))))) |
6143 |
|
|
6144 |
(defun tramp-coding-system-change-eol-conversion (coding-system eol-type) |
(defun tramp-coding-system-change-eol-conversion (coding-system eol-type) |
6145 |
"Return a coding system like CODING-SYSTEM but with given EOL-TYPE. |
"Return a coding system like CODING-SYSTEM but with given EOL-TYPE. |