Eugene
Eugene

Reputation: 277

How to manage files/directories discovery and use in c++ on windows?

I'm stuck in terms of solutions for such thing.

ifstream infile;  
string STRING = "";  
string cdd = "PATH HERE";  
infile.open(cdd);  
while (!infile.eof())  
{  
getline(infile, STRING);  
}  

This is what I achieve through fstream library, and I find it fine, now the problem comes when I need to scan the directory(for files and directories) where the .exe is placed and obtain a list which I can iterate to find directories/files and which I use to pass the path string to cdd. I found different libraries such as , and , but because of the different types used in each library, I can't figure out how to nest functionalities that I need. If there is no way to nest such functionalities, someone can point to a 1 file only library that achieve such needed tasks?

Upvotes: 0

Views: 165

Answers (1)

GSIO01
GSIO01

Reputation: 501

If your compiler supports C++17 and you can/want to use it you can use filesystem which is part of C++17.

Upvotes: 1

Related Questions