fs::read_dir can locate a file but fs::read_to_str can't open it
I have some code where I need to parse a file to generate a character tree. However, the main access point is supposed to be through the directory.
Essentially, when I perform a read_dir on the directory, the correct file is found. Then the path of this new file is passed into a different function, and the new function tries to perform a read_to_string of the path.
At this point, the code panics with the error message "No such OS or Directory found". I checked the source code for read_to_string, and it appears that it uses File::open()? under the hood. Any ideas why this may be failing? I'm running ubuntu on a WSL system, btw.
Edit: I forgot to say before that the file and directory both have read permission for all users