So for a final C++ project im working on right now for college, we need to create a program that will run through a folder and all the folders within it and count and list the counts of all the different type of files within the folder
so our teacher gave us a method for scanning the folder but we need to do the work for listing the files.
so i looked at her method that she gave us and im just a bit confused as to how it works
what does the directory_iterator e do? i know its used for deciding when the for loop finishes but how can it do that if it doesnt get initialized to anything?
and also what does the following bit of code do?: path p = d->path();
sorry for the big post but any help you can give me is highly appreciated
void scan(path f, unsigned i=0)
string indent(i, '\t');
// system_complete converts a file or directory to a complete one
cout << indent << "Folder = " << system_complete(f) << endl;
for( ; d != e; ++d)
path p = d->path();
cout << indent << p << (is_directory(d->status())?" [dir]":"") << endl;
scan(f / p, i+1); // recursion occurs