summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-08-21 20:09:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-08-21 20:09:11 -0700
commit5edadcdff0d80ceb5639dc31bbe7c2b43a1d2782 (patch)
treea8c900162613c7371b4cb3b836f17129b8a01308 /txr.1
parent342d92341cade83e4ac981f557a5af44846370cc (diff)
downloadtxr-5edadcdff0d80ceb5639dc31bbe7c2b43a1d2782.tar.gz
txr-5edadcdff0d80ceb5639dc31bbe7c2b43a1d2782.tar.bz2
txr-5edadcdff0d80ceb5639dc31bbe7c2b43a1d2782.zip
Default the length argument of truncate-stream.
* stream.c (truncate_stream): If the len argument is missing, default to the current position, obtained by using the seek operation. (stream_init): Fix up registration of truncate-stream for one optional argument. * txr.1: Documentation of truncate-stream updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.117
1 files changed, 16 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index b228334f..911143dd 100644
--- a/txr.1
+++ b/txr.1
@@ -42537,7 +42537,7 @@ On failure, it throws an exception of type
.coNP Function @ truncate-stream
.synb
-.mets (truncate-stream < stream << length )
+.mets (truncate-stream < stream <> [ length ])
.syne
.desc
The
@@ -42550,6 +42550,21 @@ bytes.
The stream must be a file stream, and must be open for writing.
+If
+.meta length
+is omitted, then it defaults to the current position, retrieved
+as if by invoking the
+.code seek-stream
+with an
+.meta offset
+argument of zero and
+.meta whence
+argument of
+.codn :from-current .
+Hence, after the
+.code truncate-stream
+operation, that position is one byte past the end of the file.
+
.coNP Functions @ stream-get-prop and @ stream-set-prop
.synb
.mets (stream-get-prop < stream << indicator )