Created
June 10, 2016 10:46
-
-
Save sebglazebrook/8657426f9ab6b4f32820cd01bb6a858f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let file_path = "my.test".to_string(); | |
let mut file = File::create(file_path).unwrap(); | |
file.write_all("ls".as_bytes()); | |
let mut process = Command::new("source") | |
.arg(file_path) | |
.spawn() | |
.unwrap_or_else(|e| { panic!("failed to execute child: {}", e) }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Returns an error:
thread '<main>' panicked at 'failed to execute child: No such file or directory (os error 2)'
but if I change the command from
source
tols
then it finds the file