So, i am getting this error when i run a command in linux terminal using std::process::Command. The part of the code is:
use std::process::Command;
fn main() {
let mut playmusic = "mpv https://www.youtube.com/watch?v=kJQP7kiw5Fk";
let status = Command::new(playmusic).status().expect("error status");
}
The above code for the command, i found at rust docs. I tried everything in the docs, but none of them worked like using wait command.
Everytime i get this error:
thread 'main' panicked at 'error status: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:46:63
Since, the error says that the command not found, i ran it in my terminal but there it ran successfully. But, when using this in std::process::Command, it fails.