Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -40,20 +40,13 @@ rmtmod (prefix mtargs args:)) (include "common_records.scm") - -;; (require-library margs) -;; (include "margs.scm") - -;; (define old-exit exit) -;; -;; (define (exit . code) -;; (if (null? code) -;; (old-exit) -;; (old-exit code))) +(define (remove-files filespec) + (let ((files (glob filespec))) + (for-each delete-file files))) (define (stop-the-train) (thread-start! (make-thread (lambda () (let loop () (if (and *toppath* @@ -60,10 +53,12 @@ (file-exists? (conc *toppath*"/stop-the-train"))) (let* ((msg (conc "ERROR: found file "*toppath*"/stop-the-train, exiting immediately"))) ;; yes, print to current-output-port AND *default-log-port*, annoying but necessary I think (print msg) (debug:print 0 *default-log-port* msg) + (remove-files (conc *toppath* "/logs/server*")) + (remove-files (conc *toppath* "/.servinfo/*")) (exit 1))) (thread-sleep! 5) (loop)))))) ;; execute thunk, return value. If exception thrown, trap exception, return #f, and emit nonfatal condition note to *default-log-port* .