Warning
- Aborting a process should be the last resort due to the risks of data loss, corruption and resource leaks.
- Always prefer a gracefull process termination using Process.close()
Process:abort() method
Aborts the running Process immediately.
Return value
This method returns aboolean
value indicating if the operation succeeded.
Example
local sysutils = require "sysutils"
local ui = require "ui"
-- create a process launching Wordpad
local p = sysutils.Process("notepad.exe")
-- start the process
p:spawn()
-- wait 5sec
sleep(5000)
if p:abort() then
ui.info("Notepad process has been aborted")
end