test_dir/ -> Created during runtime but has a constant name in all execution.
abc/ -> Created during runtime but name gets changed for every execution.
Since abc/ name is not a constant one, How I can confirm whether test_dir/auto_generated_dir/file.txt file actually created.
let mut path = PathBuf::from("test_dir");
loop {
let dir = get_dynamically_generated_dir();
path.push(dir);
path.push("file.txt");
if path.exists() {
// Do stuff
}
path.pop(); path.pop();
}