diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-02-07 20:05:06 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-02-07 20:05:06 -0800 |
commit | 3f229bc3ffd56da0742555d902cd3dce1697394b (patch) | |
tree | 79f9e06c33d252118427ca59cec46fe37ef35bf8 /share | |
parent | 418f661cedc045889b23a0f2881a7049b3d008a4 (diff) | |
download | txr-3f229bc3ffd56da0742555d902cd3dce1697394b.tar.gz txr-3f229bc3ffd56da0742555d902cd3dce1697394b.tar.bz2 txr-3f229bc3ffd56da0742555d902cd3dce1697394b.zip |
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.
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/getput.tl | 2 |
1 files changed, 1 insertions, 1 deletions
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))) |