Process:abort() method

Aborts the running Process immediately.

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()

Return value

This method returns a boolean 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