加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

与Elixir / Erlang同步执行Shell命令

发布时间:2020-12-15 21:52:01 所属栏目:安全 来源:网络整理
导读:我想执行一个(慢) python脚本,我希望我的Elixir进程阻塞,直到它收到脚本的所有输出. 是Elixir的System.cmd / 3还是Erlang的os:cmd / 1保证同步?如果没有,是否有其他方式进行同步操作系统调用? 解决方法 os:cmd Executes Command in a command shell of th
我想执行一个(慢) python脚本,我希望我的Elixir进程阻塞,直到它收到脚本的所有输出.

是Elixir的System.cmd / 3还是Erlang的os:cmd / 1保证同步?如果没有,是否有其他方式进行同步操作系统调用?

解决方法

os:cmd

Executes Command in a command shell of the target OS,captures the
standard output of the command and returns this result as a string.
This function is a replacement of the previous unix:cmd/1; on a Unix
platform they are equivalent.

此命令是同步的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读