Provides Process operation APIs for process creation, standard stream obtaining, process waiting, and process information querying.
This package is available on Linux, macOS, Windows, and HarmonyOS.
Name Description
execute Creates and runs a subprocess based on input parameters, waits until the subprocess is complete, and returns the exit status of the subprocess.
executeWithOutput Creates and runs a subprocess based on input parameters, waits until the subprocess is complete, and returns the exit status, standard output, and standard error of the subprocess.
findProcess Binds a process instance based on the input process ID.
launch Creates and runs a subprocess based on input parameters and returns a subprocess instance.
Name Description
CurrentProcess (deprecated) Specifies the current process class inherited from the Process class and provides functionalities related to operations on the current process.
Process Specifies a process class which provides functionalities related to process operations.
SubProcess Specifies a subprocess class inherited from the Process class and provides functionalities related to subprocess operations.
Name Description
ProcessRedirect Sets the redirection mode of the subprocess standard stream when a process is created.
Name Description
ProcessException Specifies the exception class of the process package.
Member Supported OS
current (deprecated) Linux, Windows, macOS, and HarmonyOS
pid Linux, Windows, macOS, and HarmonyOS
name Linux, Windows, macOS, and HarmonyOS
command Linux, Windows, macOS, and HarmonyOS
arguments (deprecated) Linux, macOS, and HarmonyOS
commandLine (deprecated) Linux, macOS, and HarmonyOS
environment (deprecated) Linux and HarmonyOS
workingDirectory (deprecated) Linux, macOS, and HarmonyOS
of(Int64) (deprecated) Linux, Windows, macOS, and HarmonyOS
start(String, Array<String>, Path, Map<String, String>, ProcessRedirect, ProcessRedirect, ProcessRedirect) (deprecated) Linux, Windows, macOS, and HarmonyOS
run(String, Array<String>, Path, Map<String, String>, ProcessRedirect, ProcessRedirect, ProcessRedirect, Duration) (deprecated) Linux, Windows, macOS, and HarmonyOS
runOutput(String, Array<String>, Path, Map<String, String>, ProcessRedirect, ProcessRedirect, ProcessRedirect) (deprecated) Linux, Windows, macOS, and HarmonyOS
terminate(Bool) Linux, Windows, macOS, and HarmonyOS
NOTE
This class will be deprecated in future releases and the functionalities in std.env will be used instead.
Member Supported OS
arguments Linux, Windows, macOS, and HarmonyOS
homeDirectory Linux, Windows, and macOS
tempDirectory Linux, Windows, and macOS
stdIn Linux, Windows, macOS, and HarmonyOS
stdOut Linux, Windows, macOS, and HarmonyOS
stdErr Linux, Windows, macOS, and HarmonyOS
atExit(() -> Unit) Linux, Windows, macOS, and HarmonyOS
exit(Int64) Linux, Windows, macOS, and HarmonyOS
getEnv(String) Linux, Windows, macOS, and HarmonyOS
removeEnv(String) Linux, Windows, macOS, and HarmonyOS
setEnv(String, String) Linux, Windows, macOS, and HarmonyOS
Member Supported OS
stdIn (deprecated) Linux, Windows, macOS, and HarmonyOS
stdInPipe Linux, Windows, macOS, and HarmonyOS
stdOut (deprecated) Linux, Windows, macOS, and HarmonyOS
stdOutPipe Linux, Windows, macOS, and HarmonyOS
stdErr (deprecated) Linux, Windows, macOS, and HarmonyOS
stdErrPipe Linux, Windows, macOS, and HarmonyOS
wait(Duration) Linux, Windows, macOS, and HarmonyOS
waitOutput() Linux, Windows, macOS, and HarmonyOS