The Process2 JavaScript class. Used to launch an external process.
More...
The Process2 JavaScript class. Used to launch an external process.
Processes can be instantiated in the scripting environment.
p1 =
new Process2(
"rndr -t file.rib" );
p2 =
new Process2(
"rndr",
"-t",
"file.rib" );
p1.launch();
p2.launch();
p3 =
new Process2(
"rndr -t file.rib" );
p3.launchAndDetach();
if ( p4.isAlive() )
{
p4.terminate();
}
◆ Process2() [1/4]
Process2::Process2 |
( |
int |
pid | ) |
|
Create a new Process. A process created with a pid cannot be launched as it already should have been. terminate() and isAlive() functions can still be called with such a process.
- Parameters
-
pid | : PID of already existing process. |
◆ Process2() [2/4]
Process2::Process2 |
( |
String |
name, |
|
|
|
... |
|
) |
| |
Create a new Process.
- Parameters
-
name | : Path or name of process to execute. |
... | : List of arguments. |
◆ Process2() [3/4]
Process2::Process2 |
( |
String |
name, |
|
|
StringList |
list |
|
) |
| |
Create a new Process.
- Parameters
-
name | : Path or name of process to execute. |
list | : List of arguments. |
◆ Process2() [4/4]
Process2::Process2 |
( |
String |
commandLine | ) |
|
Create a new Process.
- Parameters
-
commandLine | : Entire command line to launch. |
◆ addEnvVariable
void Process2::addEnvVariable |
( |
String |
name, |
|
|
String |
value |
|
) |
| |
|
slot |
◆ commandLine
String Process2::commandLine |
( |
| ) |
|
|
slot |
Fetch command line to be executed in this process.
- Returns
- Returns the command line as a single string.
◆ errorCode
int Process2::errorCode |
( |
| ) |
|
|
slot |
Fetch error code.
- Returns
- Returns the error code. Returns 0 if no error.
◆ errorMessage
String& Process2::errorMessage |
( |
| ) |
|
|
slot |
Fetch error message.
- Returns
- Returns the error message associated with the error code. Returns an empty string if no error.
◆ isAlive
bool Process2::isAlive |
( |
| ) |
|
|
slot |
Verify if process is still alive.
- Returns
- Returns the state of the process. Returns true if the process is still alive.
◆ launch
Launch process.
- Returns
- Returns -1 if any error or process has been aborted, else return the process exit code, success is 0 in most of the time.
◆ launchAndDetach
int Process2::launchAndDetach |
( |
| ) |
|
|
slot |
Launch process and detach it from application.
- Returns
- Returns any error code. Returns 0 if no error.
◆ pid
Fetch process PID.
- Returns
- Returns the PID. Returns -1 if no process started.
◆ resetEnvVariableList
void Process2::resetEnvVariableList |
( |
| ) |
|
|
slot |
◆ terminate
void Process2::terminate |
( |
| ) |
|
|
slot |