System

Moduleejs.sys
Definition class System
InheritanceSystem inherit Object
Specifiedejscript-1.1
StabilityPrototype.

System is a utility class providing methods to interact with the operating system.


Properties

QualifiersPropertyTypeDescription
public static const BufsizeNumber 
public static get hostnameStringThe fully qualified system hostname.

System Methods

QualifiersMethod
public static kill(pid: Number, signal: Number = 2): Boolean
 Kill the specified process.
public static run(cmd: String): String
 Execute a command/program.

Method Detail

static public kill(pid: Number, signal: Number = 2): Boolean

Kill the specified process.

Parameters
pid: Number Process ID of the process to kill.
signal: Number If pid is greater than zero, the signal is sent to the process whoes ID is pid. If pid is zero, the process is tested but no signal is sent. [default: 2]
Returns
True if successful.
Throws
IOError: if the pid is invalid or if the requesting process does not have sufficient privilege to send the signal.

static public run(cmd: String): String

Execute a command/program.

Parameters
cmd: String Command or program to execute.
Returns
A text stream connected to the programs standard output.
Throws
IOError: if the command exits with non-zero status.