Object built-in object

Object SubProcess

Child process object

1 2
var process = require("process"); var sub = process.open("ls");

Inheritance

Member attributes

pid

Integer, read the id of the process pointed to by the current object

1
readonly Integer SubProcess.pid;

ppid

Integer, read the id of the parent process pointed to by the current object

1
readonly Integer SubProcess.ppid;

stdin

BufferedStream , read the standard input object of the process pointed to by the current object

1
readonly BufferedStream SubProcess.stdin;

stdout

BufferedStream , read the standard output object of the process pointed to by the current object

1
readonly BufferedStream SubProcess.stdout;

stderr

BufferedStream , read the standard error object of the process pointed to by the current object

1
readonly BufferedStream SubProcess.stderr;

Member function

kill

Kill the process pointed to by the current object and pass the signal

1
SubProcess.kill(Integer signal);

Call parameters:

  • signal : Integer, the signal passed

wait

Wait for the end of the process pointed to by the current object, and return the process end code

1
Integer SubProcess.wait() async;

Return result:

  • Integer , the end code of the process

findWindow

Query whether there is a window with the specified name in the process pointed to by the current object, windows only

1
Value SubProcess.findWindow(String name);

Call parameters:

  • name : String, window name

Return result:

  • Value , the rect of the window is returned if the window exists, otherwise undefined

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String SubProcess.toString();

Return result:

  • String , returns the string representation of the object

toJSON

Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object

1
Value SubProcess.toJSON(String key = "");

Call parameters:

  • key : String, unused

Return result:

  • Value , returns a value containing JSON serializable