Function: org-file-newer-than-p

org-file-newer-than-p is a byte-compiled function defined in org-macs.el.

Signature

(org-file-newer-than-p FILE TIME)

Documentation

Non-nil if FILE modification time is greater than TIME.

TIME should be obtained earlier for the same FILE name using

  (file-attribute-modification-time (file-attributes file))

If TIME is nil (file did not exist) then any existing FILE is considered as a newer one. Some file systems have coarse timestamp resolution, for example 1 second on HFS+ or 2 seconds on FAT, so nil may be returned when file is updated twice within a short period of time. File timestamp and system clock current-time may have different resolution, so attempts to compare them may give unexpected results.

Consider file-newer-than-file-p to check up to date state in target-prerequisite files relation.

Source Code

;; Defined in ~/.emacs.d/elpa/org-9.8.2/org-macs.el
;;; File

(defun org-file-newer-than-p (file time)
  "Non-nil if FILE modification time is greater than TIME.
TIME should be obtained earlier for the same FILE name using

  \(file-attribute-modification-time (file-attributes file))

If TIME is nil (file did not exist) then any existing FILE
is considered as a newer one.  Some file systems have coarse
timestamp resolution, for example 1 second on HFS+ or 2 seconds on FAT,
so nil may be returned when file is updated twice within a short period
of time.  File timestamp and system clock `current-time' may have
different resolution, so attempts to compare them may give unexpected
results.

Consider `file-newer-than-file-p' to check up to date state
in target-prerequisite files relation."
  (let ((mtime (file-attribute-modification-time (file-attributes file))))
    (and mtime (or (not time) (time-less-p time mtime)))))