Process (open)
Process objecttype
Syntax
LOADLIB "wh::os.whlib";
OBJECTTYPE Process
Variables
- STRING initialworkingdirectory
If not empty, sets the process initial current working directory
- BOOLEAN share_stderr
Whether to share the error stream with the running process (used when starting the process)
- BOOLEAN share_stdin
Whether to share the input stream with the running process (used when starting the process)
- BOOLEAN share_stdout
Whether to share the output stream with the running process (used when starting the process)
- RECORD userdata (inherited from __HS_INTERNAL_OutputObject)
Data for the user of this object
Properties
- PROPERTY errors_handle
Errors handle (0 if errors is not taken)
- PROPERTY exitcode
Exit code of process, -1 if still running
- PROPERTY handle (inherited from __HS_INTERNAL_OutputObject)
Handle
- PROPERTY input_handle
Input handle (0 if input is not taken)
- PROPERTY output_handle
Output handle (0 if output is not taken)
- PROPERTY pid
pid of process, -1 if still running
Functions
- OBJECT FUNCTION AsyncWaitRead(DATETIME until)
Returns a promise that will be resolved when this output object becomes read signalled
- MACRO Close()
Closes the process, and releases all resources
- MACRO CloseInput()
Closes the process input
- MACRO Detach()
Detach the process.
- BOOLEAN FUNCTION IsReadSignalled()
Returns whether this object is read-signalled
- BOOLEAN FUNCTION IsRunning()
Return whether the process is running
- BOOLEAN FUNCTION IsSignalled() (inherited from __HS_INTERNAL_OutputObject)
Returns whether this object is signalled (read or write).
- BOOLEAN FUNCTION IsWriteSignalled()
Returns whether this object is write-signalled
- MACRO SendInterrupt()
Sents an interrupt signal to the process.
- MACRO SetEnvironment(RECORD ARRAY environment)
Sets the environment of the process. Must be called before starting the process
- BOOLEAN FUNCTION Start()
Start the process
- MACRO Terminate()
Terminates (SIGKILL) the process.
- BOOLEAN FUNCTION Wait(DATETIME until)
Waits until this output has become signalled (read or write)