Call Whenever File Changes
;;; ,open threads
(define (call-whenever-file-changes filename thunk interval)
(let loop ((prev-modtime (file-info:mtime (file-info filename))))
(process-sleep interval)
(let ((this-modtime (file-info:mtime (file-info filename))))
(if (not (= this-modtime prev-modtime))
(thunk))
(loop this-modtime))))
CallWheneverFileChanges - raw wiki source |
code snippets archive
|