summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-02-07 20:05:06 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-02-07 20:05:06 -0800
commit26a5ec711f60c65d74e1fee0b539372a492a3e6f (patch)
tree79f9e06c33d252118427ca59cec46fe37ef35bf8
parent2d646b1dfde4259731e04bf87461b0bf769d51e2 (diff)
downloadtxr-26a5ec711f60c65d74e1fee0b539372a492a3e6f.tar.gz
txr-26a5ec711f60c65d74e1fee0b539372a492a3e6f.tar.bz2
txr-26a5ec711f60c65d74e1fee0b539372a492a3e6f.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.
-rw-r--r--share/txr/stdlib/getput.tl2
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)))