Created
February 13, 2013 05:16
-
-
Save jmdeldin/4942461 to your computer and use it in GitHub Desktop.
Some Elisp for getting the last modified date of files and comparing two files. The original idea was to use this for comparing whether a tangled .el file from org-babel was as new as the source .org file, but it turns out org-babel-load-file already does this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun get-last-modifed (file) | |
"Returns the last modified date of a FILE." | |
(interactive) | |
(format-time-string "%Y-%m-%d %T" | |
(nth 5 (file-attributes file)))) | |
(defun most-recent-p (file1 file2) | |
"Returns t if FILE1 was modified more recently than FILE2." | |
(string< (get-last-modifed file1) (get-last-modifed file2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment