rust - 如何使用`std::io::Command`
问题描述
我正在尝试在 Rust 中执行以下代码:
use std::io::Command;
fn main() {
let the_output = Command::new("ruby").arg(["-e", "puts 'raja'", "x"]).output()
}
但它抛出了这个错误:
error[E0432]: unresolved import `std::io::Command`
--> src\main.rs:1:5
|
1 | use std::io::Command;
| ^^^^^^^^^^^^^^^^ no `Command` in `io`
有人可以指导我如何将其导入use std::io::Command;
我的程序吗?
解决方案
没有一个std::io::Command
。你可能在想std::process::Command
。
推荐阅读
- oracle - 交互式网格在更新 (19.1) 时抛出 ORA-01858
- proxy - 代理服务器从 ODOO python 中的上游服务器收到无效响应
- ios - 如何使用 Firestore 数据库在 swift 中为 tableview 中的项目列表设置 postkey?
- javascript - 修复 Javascript 中的反射 XSS 问题。检查马克思
- linux - 加载共享库时出错:__vdso_time:dlopen() 的无效模式:无效参数
- python - 在 Idle (Python 3.7.4) 中输入 import nltk 后,我得到一个 ModuleNotFoundError: No module named "nltk"
- airflow - iam.gserviceaccount.com 没有 storage.buckets.get 访问权限
- git - “发生错误。详细消息:1 个未提交的更改将被合并覆盖”
- visual-studio - 如何更改应用程序主页面标题中文本的大小和样式?
- python - 如何将关键字参数传递给 pre-forward 钩子使用的 forward?