Is there a Rust equivalent to the system
function in the C/C++ standard library? Specifically I am trying to use cls
to clear the command line.
相关问题
- Share Arc between closures
- Function references: expected bound lifetime param
- Pattern matching on slices
- How can I iteratively call Sha256::digest, passing
- Destructure a vector into variables and give away
相关文章
- How can I convert a f64 to f32 and get the closest
- What is a good way of cleaning up after a unit tes
- How can I unpack (destructure) elements from a vec
- How to import macros in Rust?
- How to get struct field names in Rust? [duplicate]
- Confusion between [T] and &[T]
- How do I initialize an opaque C struct when using
- What's the most idiomatic way to test two Opti
The mentioned methods did not work for me
Cargo.toml
Code
Example
You could use C's
system
function through thelibc
crate. But fortunately there's a much better way:std::process::Command
.A quick and dirty way to call
cls
would be