os.process 包主要提供 Process 进程操作接口,主要包括进程创建,标准流获取,进程等待,进程信息查询等。
本包提供多平台统一操控能力,目前支持 Linux 平台,macOS 平台,Windows 平台与 HarmonyOS 平台。
| 成员 | 支持平台 |
| current | Linux、Windows、macOS、HarmonyOS |
| pid | Linux、Windows、macOS、HarmonyOS |
| name | Linux、Windows、macOS、HarmonyOS |
| command | Linux、Windows、macOS、HarmonyOS |
| arguments | Linux、macOS、HarmonyOS |
| commandLine | Linux、macOS、HarmonyOS |
| workingDirectory | Linux、macOS、HarmonyOS |
| environment | Linux、HarmonyOS |
| of(Int64) | Linux、Windows、macOS、HarmonyOS |
| start(String, Array, Path, Map<String, String>, ProcessRedirect, ProcessRedirect, ProcessRedirect) | Linux、Windows、macOS、HarmonyOS |
| run(String, Array, Path, Map<String, String>, ProcessRedirect, ProcessRedirect, ProcessRedirect, Duration) | Linux、Windows、macOS、HarmonyOS |
| runOutput(String, Array, Path, Map<String, String>, ProcessRedirect, ProcessRedirect, ProcessRedirect) | Linux、Windows、macOS、HarmonyOS |
| terminate(Bool) | Linux、Windows、macOS、HarmonyOS |