summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stdlib/getput.tl4
-rw-r--r--txr.16
2 files changed, 8 insertions, 2 deletions
diff --git a/stdlib/getput.tl b/stdlib/getput.tl
index 4102853e..3b583d73 100644
--- a/stdlib/getput.tl
+++ b/stdlib/getput.tl
@@ -97,7 +97,7 @@
(put-lines lines s)))
(defun file-get-buf (name : bytes (seek 0))
- (with-stream (s (open-file name "rb"))
+ (with-stream (s (open-file name (if bytes "rbu" "rb")))
(sys:get-buf-common s bytes seek)))
(defun file-put-buf (name buf : (seek 0))
@@ -164,7 +164,7 @@
(put-lines lines s)))
(defun command-get-buf (cmd : bytes (skip 0))
- (with-stream (s (open-command cmd "rb"))
+ (with-stream (s (open-command cmd (if bytes "rbu" "rb")))
(sys:get-buf-common s bytes skip)))
(defun command-put-buf (cmd buf)
diff --git a/txr.1 b/txr.1
index 28274987..e95238a8 100644
--- a/txr.1
+++ b/txr.1
@@ -27515,6 +27515,12 @@ If possible, the semantics of this parameter is achieved by performing a
operation, falling back on reading and discarding bytes if the
stream doesn't support seeking.
+If
+.meta max-bytes
+is specified, then the stream is opened in unbuffered mode, so that bytes
+beyond the specified range shall not be requested from the underlying file,
+device or process.
+
.coNP Functions @, file-put-buf @ file-append-buf and @ command-put-buf
.synb
.mets (file-put-buf < name < buf << skip-bytes )