【问题标题】:How can I call OS commands from within ballerina如何从芭蕾舞演员中调用操作系统命令
【发布时间】:2019-08-19 14:27:45
【问题描述】:
【问题讨论】:
标签:
operating-system
ballerina
【解决方案1】:
这将通过ballerina/system 模块与ballerina-1.0.0 一起提供。 API 将如下所示。
# Executes an operating system command as a subprocess of the current process.
#
# + command - The name of the command to be executed
# + env - Environment variables to be set to the process
# + dir - The current working directory to be set to the process
# + args - Command arguments to be passed in
# + return - Returns a `Process` object in success, or an `Error` if a failure occurs
public function exec(@untainted string command, @untainted map<string> env = {},
@untainted string? dir = (), @untainted string... args)
returns Process|Error = external;