From 5fdf0265362164cf4805bfb261721a4b92250349 Mon Sep 17 00:00:00 2001 From: w6vvn Date: Tue, 9 Sep 2025 16:04:58 -0700 Subject: [PATCH] support for copying the temporary file from an existing file --- palps.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/palps.rkt b/palps.rkt index cf06851..476aba9 100755 --- a/palps.rkt +++ b/palps.rkt @@ -8,13 +8,15 @@ (or/c char-numeric? char-alphabetic? (curry char=? #\-)) (string->list call)))) -(define (our-make-temporary-file) +(define (our-make-temporary-file [copy-from #f]) ;; when deployed as a systemd socket, this program is expected to be ;; ran with PrivateTmp. however, in case this is not true, we still ;; make our own directory. "red", the restricted version of "ed", ;; has no facility for getting outside of the directory we start it ;; in. - (make-temporary-file "red.~a" #:base-dir (make-temporary-directory))) + (make-temporary-file "red.~a" + #:copy-from copy-from + #:base-dir (make-temporary-directory))) ;; unfortunately, we cannot just exec red and let it take over the ;; I/O. ed, being the standard text editor, only works with standard