#include <GProcess.h>
Public Member Functions | |
OsProcess | Handle () |
OsProcessId | GetId () |
int | ExitValue () |
bool | Terminate () |
Stops the process right now, use with care. | |
bool | IsRunning () |
bool | Run (const char *Exe, const char *Args, const char *Dir, bool Wait, GStream *In=0, GStream *Out=0, int Priority=0) |
Starts a new process. |
OsProcess GProcess::Handle | ( | ) |
OsProcessId GProcess::GetId | ( | ) |
int GProcess::ExitValue | ( | ) |
bool GProcess::IsRunning | ( | ) |
bool GProcess::Run | ( | const char * | Exe, | |
const char * | Args, | |||
const char * | Dir, | |||
bool | Wait, | |||
GStream * | In = 0 , |
|||
GStream * | Out = 0 , |
|||
int | Priority = 0 | |||
) |
Starts a new process.
Exe | The path to the executable to run |
Args | The arguments to pass to the program |
Dir | The current directory to start the program in |
Wait |
If true, calling Run will block until the process exits, else Run will exit after starting the process. The parameters In and Out are only used if Wait=true |
In | A stream to supply input to the process. Only used if Wait=true. |
Out | A stream to capture output from the process. Only used if Wait=true. |
Priority | The priority to run the process at. -2 = idle -1 = low 0 = normal 1 = high 2 = realtime(ish) |
References GArray< Type >::Add(), GStreamI::GetSize(), IsRunning(), GArray< Type >::Length(), LGI_OS_WIN9X, LGI_PATH_SEPARATOR, LgiSleep, GStringPipe::NewStr(), GStringPipe::Push(), GStream::Read(), and GStream::Write().
Referenced by SystemFunctions::Execute(), GApp::GetFileMimeType(), LgiGetExeFile(), LgiGetSystemPath(), and GSymLookup::Lookup().