Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationProcess

Introduction

The ProcessObject represents a running system process.

It is typically returned by functions that launch external programs or commands and provides limited control and inspection capabilities.

Internally, it wraps a java.lang.Process instance.

All functions exposed by this object require a permission level of 0.

Process object functions

The following is a list of internal functions the ProcessObject exposes. All functions are ZPEObjectNativeFunctions therefore run in native code.

stop() ⇒ boolean
Forcibly terminates the running process. Returns true once the termination request has been issued.
info() ⇒ map
Returns a map containing information about the running process. The returned map contains:
  • command — The command used to launch the process
  • arguments — The arguments supplied to the command
  • user — The user running the process
  • cpu_duration — Total CPU time consumed by the process

Examples

Assuming a process has been started and returned as a ProcessObject:

YASS
$proc = run("ping google.com")   # Hypothetical example

$info = $proc->info()

print($info["command"])
print($info["cpu_duration"])

Stopping a running process:

YASS
$proc->stop()

Notes:

  • Process origin: ProcessObject instances are typically created internally when launching external commands.
  • Forceful termination: The stop() method uses a forceful termination mechanism.
  • System-dependent: Available process information may vary depending on the operating system.
Comments

There are no comments on this page.

New comment

Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.

Comments powered by BalfComment

Feedback 👍
Comments are sent via email to me.