Namespace: process

cep. process

Reads and/or initializes processes

Source:

Members


<static, constant> cep.util.ERR_INVALID_URL :ErrorCode

Type:
Source:

<static, constant> ERR_EXCEED_MAX_NUM_PROCESS :ErrorCode

Type:
Source:

Methods


<static> cep.fs.deleteFile(path)

Deletes a file.

Parameters:
Name Type Description
path string

The path of the file to delete.

Source:
Returns:

An object with this property:


  • "err": The status of the operation, one of:
  • NO_ERROR

  • ERR_UNKNOWN

  • ERR_INVALID_PARAMS

  • ERR_NOT_FOUND

  • ERR_NOT_FILE


Type
object | ErrorCode

<static> createProcess(arguments)

Creates a process.

Parameters:
Name Type Description
arguments list

The arguments to create process. The first one is the full path of the executable, followed by the arguments of the executable.

Source:
Returns:

An object with these properties:


  • "data": The pid of the process, or -1 on error.

  • "err": The status of the operation, one of

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_EXCEED_MAX_NUM_PROCESS

    • ERR_NOT_FOUND

    • ERR_NOT_FILE



Type
object | ErrorCode

<static> getWorkingDirectory(pid)

Retrieves the working directory of a process.

Parameters:
Name Type Description
pid number

The pid of the process.

Source:
Returns:

An object with these properties:


  • "data": The path of the working directory.

  • "err": The status of the operation, one of

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode

<static> isRunning(pid)

Reports whether a process is currently running.

Parameters:
Name Type Description
pid number

The pid of the process.

Source:
Returns:

An object with these properties:


  • "data": True if the process is running, false otherwise.

  • "err": The status of the operation, one of

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode

<static> onquit(pid, callback)

Registers a handler for the onquit callback of a process.

Parameters:
Name Type Description
pid number

The pid of the process.

callback function

The handler function.

Source:
Returns:

An object with this property:


  • "err": The status of the operation, one of:

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode

<static> stderr(pid, callback)

Registers up a standard-error handler for a process.

Parameters:
Name Type Description
pid number

The pid of the process.

callback function

The handler function for the standard error callback.

Source:
Returns:

An object with this property:


  • "err": The status of the operation, one of:

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode

<static> stdin(pid, data)

Writes data to the standard input of a process.

Parameters:
Name Type Description
pid number

The pid of the process

data string

The data to write.

Source:
Returns:

An object with this property:


  • "err": The status of the operation, one of:

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode

<static> stdout(pid, callback)

Registers a standard-output handler for a process.

Parameters:
Name Type Description
pid number

The pid of the process.

callback function

The handler function for the standard output callback.

Source:
Returns:

An object with this property:


  • "err": The status of the operation, one of:

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode

<static> terminate(pid)

Terminates a process.

Parameters:
Name Type Description
pid number

The process ID

Source:
Returns:

An object with this property:


  • "err": The status of the operation, one of:

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode

<static> waitfor(pid)

Waits for a process to quit.

Parameters:
Name Type Description
pid number

The pid of the process.

Source:
Returns:

An object with this property:


  • "err": The status of the operation, one of:

    • NO_ERROR

    • ERR_UNKNOWN

    • ERR_INVALID_PARAMS

    • ERR_INVALID_PROCESS_ID



Type
object | ErrorCode