Import std.os.process_child
std.os.process_child
Child, a program that a Command started, which runs beside this one: its Id, its piped streams, a Writer to its stdin and Readers of its stdout and stderr, and Wait, TryWait, and Kill, with the ExitStatus that says how it ended.
std/os/process_child.fb
Types
ExitStatus
struct
Public Struct ExitStatus Implements Printable
How a child ended: with the code it exited with, or by a signal, as Kill ends one.
std/os/process_child.fb, line 29
-
The code it exited with, which on Windows is from 0 to 4294967295, or Null when a signal ended it.
-
The signal that ended it, as 9 for Kill, on Windows too, or Null when it exited.
-
Whether it exited with 0, which says it went well.
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
Child
class
Public Class Child
A program that a Command started, which runs beside this one until it ends, whether or not this program waits for it. Letting go of it, and of its streams, closes its pipes, but doesn't end it.
std/os/process_child.fb, line 60
-
Its stdin, when the Command piped it, a Writer to what the child reads.
-
Its stdout, when the Command piped it, a Reader of what the child writes there.
-
Its stderr, when the Command piped it.
-
The OS's number for its process.
-
Waits for it to end, and gives how it did. Its stdin closes first, so a child that reads to its end doesn't wait for more.
-
Wait's Async twin, which waits on the main thread instead of blocking it.
-
How it ended, or Null while it runs.
-
Ends it at once, unless it's ended already: by SIGKILL, or on Windows TerminateProcess, either way with Signal 9. Throws an IOError when the OS won't.
ChildInput
class
Public Class ChildInput Implements Writer
A child's stdin, which writes to what it reads. Bytes go to the child as they're written, and Write returns once they have.
std/os/process_child.fb, line 117
-
Throws an IOError once the stream is closed, or the child has gone.
-
Write's Async twin, which waits on the main thread instead of blocking it.
Doc from
std.io.streams.Writer.WriteAsync. -
Closes it once what's written has gone, so the child reads to its end. Closing it again does nothing.
ChildOutput
class
Public Class ChildOutput Implements Reader
A child's stdout or stderr, which reads what it writes there, as it comes, until it ends or closes it.
std/os/process_child.fb, line 156
-
Reads up to into.Count bytes into the start of
into, and gives how many it read: one at least, or 0 once the stream has ended, or for an empty Buffer.Doc from
std.io.streams.Reader.Read. -
Read's Async twin, which waits on the main thread instead of blocking it. One that can only block reads with Read.
Doc from
std.io.streams.Reader.ReadAsync.
Report an issue with this page or with FutureBlitz on GitHub.