create folder "received" if it doesnt exist

This commit is contained in:
Mystikfluu 2023-05-23 20:03:13 +02:00
parent 0d52fa209b
commit 5403ed31b7

View File

@ -233,6 +233,10 @@ fn main() {
println!("Received all packets, writing to file");
//create folder "received" if it does not exist
std::fs::create_dir_all("received").expect("Failed to create directory");
//write packets to file
let mut file = std::fs::File::create("received/".to_string()+filename).expect("Failed to create file");
for i in 0..packets.len() {