pub const StdIo = union(enum) inherit: inheritInherit the corresponding stream from the parent process.
file: FilePass an already open file from the parent to the child.
Nonblocking mode will be kept in the child process if present. This is likely not supported by the child process. For example:
ignore: ignorePass a null stream to the child process by opening "/dev/null" on POSIX and "NUL" on Windows.
pipe: pipeCreate a new pipe for the stream.
The corresponding field (stdout, stderr, or stdin) will be assigned a File object that can be used to read from or write to the pipe.
close: closeSpawn the child process with the corresponding stream missing. This will likely result in the child encountering EBADF if it tries to use stdin, stdout, or stderr, or if only one stream is closed, it will result in them getting mixed up. Generally, this option is for advanced use cases only.
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443 pub const StdIo = union(enum) {
/// Inherit the corresponding stream from the parent process.
inherit,
/// Pass an already open file from the parent to the child.
///
/// Nonblocking mode will be kept in the child process if present. This is
/// likely not supported by the child process. For example:
/// - Zig's std.Io.File.stdout() assumes blocking mode
/// - Rust explicity documents that nonblocking stdio may cause panics
/// - C++ standard streams do not support nonblocking file descriptors
file: File,
/// Pass a null stream to the child process by opening "/dev/null" on POSIX
/// and "NUL" on Windows.
ignore,
/// Create a new pipe for the stream.
///
/// The corresponding field (`stdout`, `stderr`, or `stdin`) will be
/// assigned a `File` object that can be used to read from or write to the
/// pipe.
pipe,
/// Spawn the child process with the corresponding stream missing. This
/// will likely result in the child encountering EBADF if it tries to use
/// stdin, stdout, or stderr, or if only one stream is closed, it will
/// result in them getting mixed up. Generally, this option is for advanced
/// use cases only.
close,
}
Behavior of the child process's standard input, output, and error streams.