| ... | @@ -31,10 +31,23 @@ pub const ChildProcess = struct { | ... | @@ -31,10 +31,23 @@ pub const ChildProcess = struct { |
| 31 | | 31 | |
| 32 | allocator: mem.Allocator, | 32 | allocator: mem.Allocator, |
| 33 | | 33 | |
| | 34 | /// The writing end of the child process's standard input pipe. |
| | 35 | /// Usage requires `stdin_behavior == StdIo.Pipe`. |
| | 36 | /// Available after calling `spawn()`. |
| 34 | stdin: ?File, | 37 | stdin: ?File, |
| | 38 | |
| | 39 | /// The reading end of the child process's standard output pipe. |
| | 40 | /// Usage requires `stdout_behavior == StdIo.Pipe`. |
| | 41 | /// Available after calling `spawn()`. |
| 35 | stdout: ?File, | 42 | stdout: ?File, |
| | 43 | |
| | 44 | /// The reading end of the child process's standard error pipe. |
| | 45 | /// Usage requires `stderr_behavior == StdIo.Pipe`. |
| | 46 | /// Available after calling `spawn()`. |
| 36 | stderr: ?File, | 47 | stderr: ?File, |
| 37 | | 48 | |
| | 49 | /// Terminated state of the child process. |
| | 50 | /// Available after calling `wait()`. |
| 38 | term: ?(SpawnError!Term), | 51 | term: ?(SpawnError!Term), |
| 39 | | 52 | |
| 40 | argv: []const []const u8, | 53 | argv: []const []const u8, |
| ... | @@ -159,10 +172,23 @@ pub const ChildProcess = struct { | ... | @@ -159,10 +172,23 @@ pub const ChildProcess = struct { |
| 159 | Unknown: u32, | 172 | Unknown: u32, |
| 160 | }; | 173 | }; |
| 161 | | 174 | |
| | 175 | /// Behavior of the child process's standard input, output, and error |
| | 176 | /// streams. |
| 162 | pub const StdIo = enum { | 177 | pub const StdIo = enum { |
| | 178 | /// Inherit the stream from the parent process. |
| 163 | Inherit, | 179 | Inherit, |
| | 180 | |
| | 181 | /// Pass a null stream to the child process. |
| | 182 | /// This is /dev/null on POSIX and NUL on Windows. |
| 164 | Ignore, | 183 | Ignore, |
| | 184 | |
| | 185 | /// Create a pipe for the stream. |
| | 186 | /// The corresponding field (`stdout`, `stderr`, or `stdin`) |
| | 187 | /// will be assigned a `File` object that can be used |
| | 188 | /// to read from or write to the pipe. |
| 165 | Pipe, | 189 | Pipe, |
| | 190 | |
| | 191 | /// Close the stream after the child process spawns. |
| 166 | Close, | 192 | Close, |
| 167 | }; | 193 | }; |
| 168 | | 194 | |