create folder "received" if it doesnt exist
This commit is contained in:
parent
0d52fa209b
commit
5403ed31b7
@ -233,6 +233,10 @@ fn main() {
|
|||||||
|
|
||||||
|
|
||||||
println!("Received all packets, writing to file");
|
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
|
//write packets to file
|
||||||
let mut file = std::fs::File::create("received/".to_string()+filename).expect("Failed to create file");
|
let mut file = std::fs::File::create("received/".to_string()+filename).expect("Failed to create file");
|
||||||
for i in 0..packets.len() {
|
for i in 0..packets.len() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user