Supposing that I have the following structure:
C:\Users\User\AppData\Folder\subfolder.suffix\wanted_file.txt
- we know that in
Folder
there's only one.suffix
subdirectory but we only know for sure its prefix ( the name may differ ). - how can I get to
wanted_file.txt
?
I've tried something like:
std::string halfpath = getenv("APPDATA");
std::string anotherhalfpath = "\\Folder\\*.suffix\\wanted_file.txt";
std::string finalpath = halfpath + anotherhalfpath;
It doesn't work this way (it prints 6-7 random chars).
The finalpath
is being printed with cout
if I remove \\*.prefix\\wanted_file.txt
from the whole path, so I suppose the syntax that I've tried it's just not good.
I'd like, if possible, a solution that doesn't involve require boost
.