StartProcess (open)
Start an OS subprocess
Syntax
LOADLIB "wh::os.whlib";
INTEGER FUNCTION StartProcess(STRING processexecutable, STRING ARRAY arguments, RECORD options)Parameters
STRING processexecutableFull path to the process executable to start
STRING ARRAY argumentsAn array of arguments to pass to the process (eg, argv[1].. argv[n])
RECORD optionsOptions
merge_output_errorsTRUE if the error stream should be merged into the output stream (requires take_output=TRUE, ignores take_errors)
separate_processgroupTRUE if the process should be created in a separate process group
take_errorsTRUE if we want to receive the process output stream (if false, it will be discarded)
take_inputTRUE if we want control of the process input stream (if false, it will be tied to EOF)
take_outputTRUE if we want to receive the process output stream (if false, it will be discarded)
virtualmemorylimitVirtual memory size - either the size in INTEGER(64) bytes or a string like "200MB", "2GB".
Return value
INTEGERID of the process, or 0 if the process could not be launched
Description
Have the OS start a process, under your direct control. Specify what input and output streams you want to process