Reputation: 75
I'm finding a way to fetch all the subfolders in a known folder, and open them, then keep finding all the subfolders in that folder, keep opening them until there aren't any subfolders left more, then move to another folder in C++. Thanks for help!
Upvotes: 0
Views: 347
Reputation: 212
Following up on Serge Ballesta's comment.
If you can compile c++17, then make use of std::filesystem.
However, if you are not able to run c++17, then you need to consider the OS you are working on.
If Linux and using GCC, use native "dirent.h"
If Windows, can use either windows.h or use a popular libarary extension of dirent.h for windows.
If using windows.h native methods, here is a SO post with solution.
If using windows extended dirent.h. Here is the github link. Just need to grab the header and add to your project.
Upvotes: 1