Atom

os.kill()

Sends a termination request.

Signature

os.kill(handle[, force])

Parameters

Open process and optional boolean force, default false.

Returns

True if sent, false if the process already exited.

Behavior

Sends SIGTERM by default and SIGKILL when forced, through libuv. Use wait to obtain a result or close to release.

Errors

Invalid handle or OS failure.

Example

Atom
use os
if os.platform != 'windows':
    p = os.spawn(['sleep', '20'])
    os.kill(p, true)
    os.close(p)