(require-extension posix) (define h-last-modified-time 0) (define h-set-timestamp (lambda (f) (unless (string=? f "mistieput") (let ((s (file-modification-time f))) (write `(if (> ,s h-last-modified-time) (set! h-last-modified-time ,s)) h-aux-port) (newline h-aux-port))))) (define h-timestamp-already-printed? #f) (define h-print-timestamp (lambda () (unless h-timestamp-already-printed? (set! h-timestamp-already-printed? #t) (unless (= h-last-modified-time 0) (display "

") (display "Last modified: ") (display (h-seconds->human-time h-last-modified-time)) (display "

") (newline))))) (define h-seconds->human-time (lambda (s) (let ((d (seconds->local-time s))) (string-append (h-month-in-words (vector-ref d 4)) " " (number->string (vector-ref d 3)) ", " (number->string (+ 1900 (vector-ref d 5))))))) (define h-the-months (vector "Jan." "Feb." "March" "April" "May" "June" "July" "Aug." "Sept." "Oct." "Nov." "Dec.")) (define h-month-in-words (lambda (n) (vector-ref h-the-months n)))