diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-06-26 20:21:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-06-26 20:21:34 -0700 |
commit | e1f183b388bb9c6e8d13b0154f82a08ed30522b0 (patch) | |
tree | b9cf064e57c1d2c64a98fb4bad7ef1250ce27d2d /autoload.c | |
parent | 8e8258ed0fab433fd6fb8d5e8480eabae9a807ca (diff) | |
download | txr-e1f183b388bb9c6e8d13b0154f82a08ed30522b0.tar.gz txr-e1f183b388bb9c6e8d13b0154f82a08ed30522b0.tar.bz2 txr-e1f183b388bb9c6e8d13b0154f82a08ed30522b0.zip |
open-process: new ?fdno option for selecting stream fd.
If, for instance ?2 is specified in the mode string argument
of open-process and related functions, this means that the
file descriptor 2 of the process will be used as the data
source (or sink) for the stream that is returned by the
function. With this feature we can easily read the standard
error of a process while leaving its standard output
unredirected.
* stream.c (do_parse_mode): Parse the ? mode option.
(open_subprocess): Check for the presence of the alternative
file descriptor in the stdio_mode structure, and and use it
isntead of STDIN_FILENO or STDOUT_FILENO.
* stream.h (struct stdio_mode): New member, streamfd.
(stdio_mode_init_blank, stdio_mode_init_r,
stdio_mode_init_rpb, stdio_mode_init_blank, stdio_mode_init_r,
stdio_mode_init_rpb): Update initializer macros to cover the
new member, setting it to the default value -1 (not
specified).
* txr.1: Documented.
Diffstat (limited to 'autoload.c')
0 files changed, 0 insertions, 0 deletions