summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-03-10 00:23:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-03-10 00:23:15 -0700
commitfbb9921f8d29350fbc69e568f90cd66379502e9c (patch)
tree9794e7b902cb9c7be7f4d58a7a61e15d1f4362e5 /txr.1
parent110e155595d397e5328f6f7af33e430d1a361bbc (diff)
downloadtxr-fbb9921f8d29350fbc69e568f90cd66379502e9c.tar.gz
txr-fbb9921f8d29350fbc69e568f90cd66379502e9c.tar.bz2
txr-fbb9921f8d29350fbc69e568f90cd66379502e9c.zip
* stream.c (pipe_close): Restructured the function a bit.
Do not throw exceptions for normal process terminations, only for abnormal ones (terminated by a signal). Return the termination status instead of just t. * txr.1: Fixed the neglected documentation of the optional boolean argument of close-stream. Described the behaviors with regard to pipes in more detail.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.119
1 files changed, 18 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index f48f1360..87e0b624 100644
--- a/txr.1
+++ b/txr.1
@@ -11685,7 +11685,7 @@ finalized, so that further output is no longer possible.
.TP
Syntax:
- (close-stream <stream>)
+ (close-stream <stream> [<throw-on-error-p>])
.TP
Description:
@@ -11697,6 +11697,23 @@ to operating system files or devices, will perform a close of the underlying
file descriptor, and dissociate that descriptor from the stream. Any buffered
data is flushed first.
+The function returns a boolean true value if the close has occurred without
+errors, otherwise nil.
+
+For most streams, "without errors" means that any buffered output data is
+flushed successfully.
+
+For command and process pipes (see open-command and open-process), success also
+means that the process terminates normally, with a successful error code, or an
+unsuccessul one. An abnormal termination is considered an error, as
+as is the inability to retrieve the termination status, as well as the situation
+that the process continues running in spite of the close attempt.
+Detecting these situations is platform specific.
+
+If the <throw-on-error-p> argument is specified, and isn't nil, then the
+function throws an exception if an error occurs during the close operation
+instead of returning nil.
+
.SS Functions get-line, get-char and get-byte
.TP