for entry in WalkDir::new(&base_path) {
match entry {
Ok(entry) => {
println!("{}", entry.path().display());
},
Err(msg) => println!("{}", msg),
}
}
When I run this part of code using debugger everything works fine except entry always is Err and the message is this:
IO error for operation on /home/admin/Documents: No such file or directory (os error 2)
but when I run this very same code using cargo from my terminal or running executable files in target, it works fine and gives Ok for all entry_s
At first I thought the problem is from debugger which somehow prevents access to my files, so I tried to open same file using std:fs:File and get it's content, and it worked perfectly even while launching with debugger
rustc -V
:cat /etc/os-release
:vscode about:
rust-analyzer version:
CodeLLDB version:
cat Cargo.toml
:My code:
When I run this part of code using debugger everything works fine except entry always is Err and the message is this: IO error for operation on /home/admin/Documents: No such file or directory (os error 2) but when I run this very same code using cargo from my terminal or running executable files in target, it works fine and gives Ok for all entry_s At first I thought the problem is from debugger which somehow prevents access to my files, so I tried to open same file using std:fs:File and get it's content, and it worked perfectly even while launching with debugger