comp • gb • process

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.

Static properties

Constants
Returns the state of the last terminated process.
LastState  
Returns the return value of the last terminated process.
LastValue  
Constant used by the State property to indicate a crashed process.
Crashed  
Constant used by the State property to indicate a running process.
Running  
A synonymous for the Crashed constant.
Signaled  
Constant used by the State property to indicate a stopped process.
Stopped  

Properties

Methods Events
Returns or sets if the stream is blocking.
Blocking  
Returns or sets the byte order used to read or write binary data to the stream.
ByteOrder  
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.
EndOfFile  
Returns or sets the newline separator used by this stream.
EndOfLine  
Returns the process identifier (a.k.a "pid") of the process object.
Handle  
A synonymous for Handle.
Id  
Return or set if the process is ignored.
Ignore  
Return if a stream is associated with a terminal.
IsTerm  
Returns a virtual object that allows you to enumerate a stream line by line.
Lines  
Returns the current state of the process object:
State  
Returns or sets the tag associated with the stream.
Tag  
Return a virtual object that allows to manage the terminal associated with the stream.
Term  
Returns the value returned by the process when it exited, or the number of the emitted signal if it crashed.
Value  
Start to buffer data written to the stream, so that everything will be sent when the Send method is called.
Begin  
Closes the stream.
Close  
Closes the process input stream.
CloseInput  
Drop the data that has been buffered since the last call to the Begin method.
Drop  
Kills the process immediately.
Kill  
Read a line of text from the stream, like the LINE INPUT instruction.
ReadLine  
Send all the data, in one shot, since the last call to Begin.
Send  
Sends a user signal to the process.
Signal  
Waits for the end of the process, like the WAIT option in SHELL and EXEC instructions.
Wait  
Start or stop watching the stream file descriptor for reading or writing, after it has been opened.
Watch  
Raised when there is data to be read on the standard error output of the process.
Error  
Raised when the process has terminated, normally or abnormally.
Kill  
Raised when there is data to be read from the standard output of the process.
Read  

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.