summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-11-07 06:37:02 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-11-07 06:37:02 -0800
commite8a6f437306d6e6dc3576a47181aad3a2b741f2b (patch)
tree0eae6d1fda66f037aa6156c6abaa00642eaebef2 /txr.1
parent22265dd7d089f9137c75042c9ede58c5e0a6d3e1 (diff)
downloadtxr-e8a6f437306d6e6dc3576a47181aad3a2b741f2b.tar.gz
txr-e8a6f437306d6e6dc3576a47181aad3a2b741f2b.tar.bz2
txr-e8a6f437306d6e6dc3576a47181aad3a2b741f2b.zip
open-process: new variant, open-subprocess.
* stream.c (open_subprocess): new function, formed by adding fun argument to open_process. Since the program name can be nil now, in which case argv is not allocated, the code must be careful not to access argv if it is null. (open_process): Reduced to trivial wrapper around open_subprocess. (stream_init): open-subprocess intrinsic registered. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.132
1 files changed, 32 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index f49c8d95..d175a774 100644
--- a/txr.1
+++ b/txr.1
@@ -50511,6 +50511,8 @@ function returns the previous value.
.synb
.mets (open-command < system-command <> [ mode-string ])
.mets (open-process < program < mode-string <> [ argument-list ])
+.mets (open-subprocess < program < mode-string
+.mets \ \ >> [ argument-list <> [ function ]])
.syne
.desc
These functions spawn external programs which execute concurrently
@@ -50754,6 +50756,36 @@ is simulated via
and therefore does not support the redirection syntax; it is parsed
and ignored.
+The
+.code open-subprocess
+function is a variant of
+.code open-process
+that is available on platforms which have a
+.code fork
+function. This function has all the same argument conventions and semantics as
+.codn open-process ,
+adding the
+.meta function
+argument. If this argument isn't
+.codn nil ,
+then it must specify a function which can be called with no arguments.
+This function is called in the child process after any redirections are
+established, just before the program specified by the
+.meta program
+argument is executed. Moreover, the
+.code open-subprocess
+function allows
+.meta program
+to be specified as
+.code nil
+in which case
+.meta function
+must be specified. When
+.meta function
+returns, the child process terminates as if by a call to
+.code exit*
+with an argument of zero.
+
.SS* I/O-Related Convenience Functions
The functions in this group create a stream, perform an I/O operation