diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-21 06:28:41 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-21 06:28:41 -0700 |
commit | 869c570ea8231596b374fd8fa62b6646d61f234e (patch) | |
tree | ccee0827aff58a37b8a3b0ce735646f135d699a2 /txr.1 | |
parent | 5ba49381b9cb3fe28771958e5d84c9fc1de1e6cf (diff) | |
download | txr-869c570ea8231596b374fd8fa62b6646d61f234e.tar.gz txr-869c570ea8231596b374fd8fa62b6646d61f234e.tar.bz2 txr-869c570ea8231596b374fd8fa62b6646d61f234e.zip |
Implementing truncate-stream.
* configure: Test for ftruncate and chsize.
* stream.c (unimpl_truncate): New static function.
(fill_stream_ops): Default the truncate operation to unimpl_truncate.
(null_ops): Initialize truncate to unimpl_truncate.
(stdio_truncate): New static function.
(stdio_ops, tail_ops): Initialize truncate to stdio_truncate.
(pipe_ops, dir_ops, string_ops, byte_in_ops, string_out_ops,
strlist_out_ops, cat_stream_ops): Initialize truncate to null,
so it gets defaulted by fill_stream_ops.
(truncate_stream): New function.
(stream_init): Register truncate-stream intrinsic.
* stream.h (struct strm_ops): New member, truncate.
(strm_ops_init): New truncate argument added to macro.
(truncate_stream): Declared.
*syslog.c (syslog_strm_ops): Initialize truncate to null.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -31010,6 +31010,21 @@ and the previous position wasn't zero, then the position is decremented by one. On failure, it throws an exception of type .codn stream-error . +.coNP Function @ truncate-stream +.synb +.mets (truncate-stream < stream << length ) +.syne +.desc +The +.code truncate-stream +causes the length of the underlying file associated with +.meta stream +to be set to +.meta length +bytes. + +The stream must be a file stream, and must be open for writing. + .coNP Functions @ stream-get-prop and @ stream-set-prop .synb .mets (stream-get-prop < stream << indicator ) |