Operations Related to Any Process
The following is an example of operations related to any process. The following example is not supported on Windows.
Code:
import std.process.*
main(): Int64 {
let echoProcess: SubProcess = launch("sleep", "10s")
let ofProcess: Process = findProcess(echoProcess.pid)
println(ofProcess.pid)
println(ofProcess.name)
println(ofProcess.command)
ofProcess.terminate(force: true)
return 0
}
Results:
70753
sleep
sleep