process.eh
Work with program processes. More...
Constants
Types
Functions
Description
This header allows you to run one program from another in a more complex
way than
exec and
exec_wait do. It provides routines to work
with program processes including process of the current program.
A process lifecycle consists of three steps.
-
A process created with new_process() is initially in PS_NEW
state. In this state you can configure it setting numerous attributes, such
as priority, input/output streams, current working directory.
-
When you call start or start_wait
process enters PS_RUNNING state. Running process executes program until
it is ended by itself or interrupted.
-
When program ends, process enters final state PS_ENDED. In this state you
can examine exit code of the process, and check if
it ended with error.
Constant details
A state of process that has been created but not yet started.
A state of process that has been started and not yet died.
A state of process that has been terminated.
The minimum priority that a process can have.
The default priority assigned to a process.
The maximum priority that a process can have.
Type details
Instance of executing program.
Function details
Returns reference to the process of current program.
Creates new process.
def Process.get_state(): Int;
|
Returns state of the process.
State is one of
PS_*
constants defined in this header.
Returns value of environment variable of this process.
Sets value to the environment variable of this process.
Returns default input stream associated with the process.
Returns default output stream associated with the process.
Returns default error stream associated with the process.
Sets new input stream for the process.
Sets new output stream for the process.
Sets new error stream for the process.
def Process.get_cwd(): String;
|
Returns current working directory of the process.
def Process.set_cwd(dir: String);
|
Sets current working directory of the process.
Starts specified program in this process.
This function can be called only in
PS_NEW
state.
After calling this function process enters
PS_RUNNING
state.
Starts specified program in this process and waits for it to die.
This function can be called only when process is in
PS_NEW
state.
Current process blocks until running process terminates.
def Process.get_priority(): Int;
|
Returns current priority of the process.
def Process.set_priority(value: Int);
|
Sets new priority to the process.
def Process.get_name(): String;
|
Returns name of the program this process executes.
Returns
null
if the process is in
PS_NEW
state.
Interrupts the process.
This function can be called only when process is in
PS_RUNNING
state. If the process is blocked waiting for some external operation,
that operation is interrupted and process receives error
ERR_INTERRUPT.
If process is running normally, this function does nothing.
def Process.get_error(): Error;
|
If process ended with error, returns corresponding error object.
def Process.get_exitcode(): Int;
|
Returns exit code of the process.