Answers for "how to run rust script"

0

run commands rust

use std::process::Command;

let mut list_dir = Command::new("ls");

// Execute `ls` in the current directory of the program.
list_dir.status().expect("process failed to execute");

println!();

// Change `ls` to execute in the root directory.
list_dir.current_dir("/");

// And then execute `ls` again but in the root directory.
list_dir.status().expect("process failed to execute");
Posted by: Guest on December-11-2020
-1

rustlang how to run a program

find your main.rs file in the source directory using the command line
Type "main" (without the quotation marks) into the terminal and press enter
Posted by: Guest on July-24-2020

Code answers related to "how to run rust script"

Browse Popular Code Answers by Language