Originally Posted by
Sebastiani
>> The C++ solutions are much more elegant, which is why I ask!
Snob. Example, please?
Like...
Code:
namespace fs = boost::filesystem;
fs::path Path("C:\\");
fs::directory_iterator it(Path), end_it;
for (; it != end_it; it++)
{
fs::file_status Status(*it);
if (Status->is_directory()); // Is directory, do something
std::string Filename(it->filename());
std::string ExtractedFilename(Filename.begin(), Filename.begin() + 4);
fs::create_directory(ExtractedFilename);
fs::rename_file(Filename, ExtractedFilename + "\\" + Filename);
}
Not tested for bugs and stuff, of course.