use std::env; use std::process; use std::fs::File; //use std::fs::read_to_string; //use std::io::{Read, BufReader, BufRead}; use std::path::Path; use std::panic; fn main() { let args: Vec = env::args().collect(); //println!("{:?}", args); if args.len()<2{ process::exit(0x0100); }else{ for file in 1..args.len() { if Path::new(&args[file]).exists(){} else{ panic!("\n\nThe file {} could not be found! Quitting!\n\n",args[file]); }; } }; for file in 1..args.len() { process::Command::new("cmd") .args(&["/C", "echo hello"]) .output() .expect("failed to execute process"); /*let contents = read_to_string(args[file].to_string()) .expect("Something went wrong reading the file"); println!("{}",contents); */ /* let input = File::open("as").expect("Fuck rust"); let mut buffered = BufReader::new(&input); for line in buffered.lines() { println!("{:?}", line); } */ } }