I am trying to create a file with colons in the name, but this code fails
Windows 10
rustc 1.37.0
use std::fs::File;
fn main() {
println!("Hello, world!");
let f = File::create("01-01-2019 16:50:30.txt".to_string()).expect("Unable to create file");
// let f = File::create("./01-01-2019 16:50:30.txt".to_string()).expect("Unable to create file");
}
Absolute and relative paths fail too
If I remove the colons, the code works.
How can I create the file?
Thanks