diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-08-21 20:09:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-08-21 20:09:11 -0700 |
commit | 5edadcdff0d80ceb5639dc31bbe7c2b43a1d2782 (patch) | |
tree | a8c900162613c7371b4cb3b836f17129b8a01308 /txr.1 | |
parent | 342d92341cade83e4ac981f557a5af44846370cc (diff) | |
download | txr-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.1 | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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 ) |