-
Hey NNB, I have a doubt with rust lang. Hoping you could help. Suppose I have a directory files in which there are some files named file1, file2, file3 and so on. Eg: use std::fs;
fn main() {
let file_name = ..;//Some code for choosing a file
let file = fs::read_to_string("./files/{}", file_name); //Is it possible to do so?
println!("{}", file);
} Sorry, element had some issues.. So sent here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Rust is on my languages-to-learn list for quite while now but I never have time to focus on learning it... So sorry... I don't have enough experience with Rust to help you much on this one.
I remember some similar thing like this with C++ so I'm pretty sure it's possible to do the same thing with any low-level programing languages include Rust. Keep try and error until it work, whisk you luck!
Actually, you post this at the very right place! I open this discussion on my dotfiles repo just so people can reach out to me ^^. |
Beta Was this translation helpful? Give feedback.
Rust is on my languages-to-learn list for quite while now but I never have time to focus on learning it...
So sorry... I don't have enough experience with Rust to help you much on this one.
I remember some similar thing like this with C++ so I'm pretty sure it's possible to do the same thing with any low-level programing languages include Rust. Keep try and error until it work, whisk you luck!
Actually, you post this at the very right place! I open this discussion on my dot…