3 # Find the newest file of each of the given directories
5 ;; Return pair (time file) for given file
7 (if (null? F) '(0 F) (list? F) F (list (file-info F 6) F)))
10 (clean (fn (x) (or (= x ".") (= x ".."))) (directory D "")))
12 ;; Return the list of full pathnames for all files in the given
13 ;; directory, excluding "." and "..".
15 (if (= D ".") (files-in D)
16 (map (fn (F) (format "%s/%s" D F)) (files-in D))))
18 ;; Return pair of (time file)
19 (define (newest FILES)
20 ;;(println (list 'newest FILES))
25 (map (fn (F) (if (directory? F) (newest (dir-list F)) F))
28 (define (report x) (format "%s %s" (date (x 0)) (x 1)))
30 (map println (map report (sort (map newest (map list (2 (main-args)))))))