summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/getput.tl10
1 files changed, 9 insertions, 1 deletions
diff --git a/share/txr/stdlib/getput.tl b/share/txr/stdlib/getput.tl
index a50ee109..b075e812 100644
--- a/share/txr/stdlib/getput.tl
+++ b/share/txr/stdlib/getput.tl
@@ -84,8 +84,16 @@
(with-stream (s (open-file name "rb"))
(sys:get-buf-common s bytes seek)))
-(defun file-put-buf (name buf)
+(defun file-put-buf (name buf : (seek 0))
(with-stream (s (open-file name "wb"))
+ (unless (zerop seek)
+ (seek-stream s seek :from-current))
+ (put-buf buf 0 s)))
+
+(defun file-place-buf (name buf : (seek 0))
+ (with-stream (s (open-file name "r+"))
+ (unless (zerop seek)
+ (seek-stream s seek :from-current))
(put-buf buf 0 s)))
(defun file-append-buf (name buf)