From 0c5c27fd2d2a4f595ea57e32f6d0cf04376cf919 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Wed, 3 Oct 2012 00:12:57 +0200 Subject: Clean up tempfiles by open/unlink combination in run/collecting* --- scsh-process.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scsh-process.scm') diff --git a/scsh-process.scm b/scsh-process.scm index b568e94..fde9186 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -115,7 +115,11 @@ ;; Documented under http://www.scsh.net/docu/html/man-Z-H-3.html#node_sec_2.4.2 (define (run/collecting* fds thunk) - (let* ((temp-files (map (lambda (fd) (open-input-file (create-temporary-file))) + (let* ((temp-files (map (lambda (fd) + (let* ((file-name (create-temporary-file)) + (port (open-input-file file-name))) + (delete-file file-name) + port)) fds)) (conns (map (lambda (from-fd temp-file) (list from-fd (port->fileno temp-file))) -- cgit v1.2.3