[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to compare time of last file modification?
From: |
Michael Albinus |
Subject: |
Re: How to compare time of last file modification? |
Date: |
Sun, 01 Jul 2012 11:23:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
"Pascal J. Bourguignon" <pjb@informatimago.com> writes:
> (defun time-lessp (t1 t2)
> "Returns whether t1<t2
> t1 and t2 are lists of two integers. The first integer has the
> high-order 16 bits of time, the second has the low 16 bits."
> (destructuring-bind (h1 l1) t1
> (destructuring-bind (h2 l2) t2
> (cond
> ((< h1 h2) t)
> ((> h1 h2) nil)
> (t (cond ((< l1 l2) t)
> (t nil)))))))
In Tramp, we use
(defun tramp-time-less-p (t1 t2)
"Say whether time value T1 is less than time value T2."
(unless t1 (setq t1 '(0 0)))
(unless t2 (setq t2 '(0 0)))
(or (< (car t1) (car t2))
(and (= (car t1) (car t2))
(< (nth 1 t1) (nth 1 t2)))))
Best regards, Michael.