Process (gb)

This class is used for managing processes launched by the EXEC or SHELL instructions.

As this class is a stream, you can use input/output instructions to read the process standard output or write to its standard input.

To read the process error output, you must use the Error event.

This class inherits Stream.

This class is not creatable.

Constants
Crashed   Constant used by the State property to indicate a crashed process.
Running   Constant used by the State property to indicate a running process.
Signaled   A synonymous for the Crashed constant.
Stopped   Constant used by the State property to indicate a stopped process.

Static properties
LastState   Returns the state of the last terminated process.
LastValue   Returns the return value of the last terminated process.

Properties
Handle   Returns the process identifier (a.k.a "pid") of the process object.
Id   A synonymous for Handle.
Ignore   Return or set if the process is ignored.
State   Returns the current state of the process object:
Value   Returns the value returned by the process when it exited, or the number of the emitted signal if it crashed.

Inherited properties
Blocking   Returns or sets if the stream is blocking.
ByteOrder   Returns or sets the byte order used to read or write binary data to the stream.
EndOfFile   This property signals whether the last use of LINE INPUT reached the end of file, instead of reading a full line with an end-of-line character.
EndOfLine   Return or set the newline separator used by this stream.
Eof   Return if a stream reached its end.
IsTerm   Return if a stream is associated with a terminal.
Lines   Returns a virtual object that allows you to enumerate a stream line by line.
NoShare  
NullTerminatedString   Return or set if strings are null-terminated when they are serialized.
Tag   Returns or sets the tag associated with the stream.
Term   Return a virtual object that allows to manage the terminal associated with the stream.

Methods
CloseInput   Closes the process input stream.
Kill   Kills the process immediately.
Signal   Sends a user signal to the process.
Wait   Waits for the end of the process, like the WAIT option in SHELL and EXEC instructions.

Inherited methods
Begin   Start to buffer data written to the stream, so that everything will be sent when the Send method is called.
Close   Closes the stream.
Drop   Drop the data that has been buffered since the last call to the Begin method.
ReadLine   Read a line of text from the stream, like the LINE INPUT instruction.
Send   Send all the data, in one shot, since the last call to Begin.
Watch   Start or stop watching the stream file descriptor for reading or writing, after it has been opened.

Events
Error   Raised when there is data to be read on the standard error output of the process.
Kill   Raised when the process has terminated, normally or abnormally.
Read   Raised when there is data to be read from the standard output of the process.

If you need to send a CTRL+D to a running process, as if you have run it in a shell, just close the Process stream.

This behaviour is deprecated since Gambas 3.9. Now closing a process stream makes it unusable, and you must use the new CloseInput method instead.