diff --git a/scsh/static.scm.in b/scsh/static.scm.in index 87883a2..1e8eadc 100644 --- a/scsh/static.scm.in +++ b/scsh/static.scm.in @@ -190,11 +190,17 @@ For testing load this at a scsh prompt ;;; if directory exists blow it away ;;; useful for repeated runs from within same scsh process (if (file-exists? (options:temp-dir options)) - (if (file-directory? (options:temp-dir otions)) - (with-cwd (options:temp-dir options) - (map delete-file (directory-files - (options:temp-dir options) #t))) - (delete-file (options:temp-dir options)))) + (cond ((file-directory? (options:temp-dir otions)) + (with-cwd (options:temp-dir options) + (let loop ((files (directory-files + (options:temp-dir options) + #t))) + (cond ((not (null? files)) + (delete-file (car files)) + (loop (cdr files)))))) + (delete-directory (options:temp-dir options))) + (else + (delete-file (options:temp-dir options))))) (create-directory (options:temp-dir options) #o755 #t) ;;; Process the info we gather to make it the output file @@ -203,8 +209,11 @@ For testing load this at a scsh prompt (compile-main-c-file start reloc options) (compile-c-image pure impure reloc externs options) (link-files options) - (map delete-file (directory-files + (let loop ((files (directory-files (options:temp-dir options) #t))) + (cond ((not (null? files)) + (delete-file (car files)) + (loop (cdr files)))))) (delete-directory (options:temp-dir options))))) ;;; read-heap-image