Notes
- A process can only be spawned once.
- You cannot restart a process once it has terminated its execution.
Process:spawn([suspended]) method
Starts the process execution.
Parameters
[suspended]
An optional boolean
value indicating if the process should be suspended once spawn, defaulting to false
.
Return value
This method returns a Task instance that will run until the process stops its execution.Example
local sysutils = require "sysutils"
local ui = require "ui"
-- create a process launching Wordpad
local p = sysutils.Process("notepad.exe")
-- start the process
local task = p:spawn()
-- wait until the process is terminated
task:wait()
ui.info("Notepad process has terminated its execution")