From 3f229bc3ffd56da0742555d902cd3dce1697394b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 7 Feb 2020 20:05:06 -0800 Subject: file-place-buf: bugfix: create file if doesn't exist. * share/txr/stdlib/getput.tl (file-place-buf): Instead of "r+" mode, use the new "mb" mode which will create the file without truncating it, and open for write mode. Also, bugfix: the "b" option was missing. --- share/txr/stdlib/getput.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/txr/stdlib/getput.tl b/share/txr/stdlib/getput.tl index b075e812..daf08b1e 100644 --- a/share/txr/stdlib/getput.tl +++ b/share/txr/stdlib/getput.tl @@ -91,7 +91,7 @@ (put-buf buf 0 s))) (defun file-place-buf (name buf : (seek 0)) - (with-stream (s (open-file name "r+")) + (with-stream (s (open-file name "mb")) (unless (zerop seek) (seek-stream s seek :from-current)) (put-buf buf 0 s))) -- cgit v1.2.3