Mam mały problem z numeracja.
Chodzi o to że za łączony program powinen tworzyć pod foldery.
gdy wpisze liczbę 2 i nazwę programy powinno utworzyć foldery o nazwie
programy-0000000-0000099
programy-0000100-0000199
gdy wpisze 11 to
programy-0000000-0000099
programy-0000100-0000199
...
programy-0001000-0001099
programy-0001100-0001199
resztę programu już mam brakuje mi tylko tej numeracji
#include <windows.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int iFolderCount;
char name[20];
std::string sMainPath = "NE100-Rotterdam OPS-IRT\\";
CreateDirectory(sMainPath.c_str(), NULL);
cout << "How many you need a subfolders:\n";
cin >> iFolderCount;
cout << "Give a Name a subfolders:\n";
cin >> name;
for (int i=0; i<=iFolderCount; ++i)
{
cout << "\n Creating ";
cout << i;
cout << ": Folder\n";
std::ostringstream ss;
ss << i;
std::ostringstream named;
named << name;
std::string sFolderName = named.str()+"-"+ ss.str() + "00-" +ss.str() + "99\\" ;
CreateDirectory((sMainPath+sFolderName).c_str(), NULL);
for (int l=0; l<=99; ++l)
{
std::ostringstream ll;
ll << l;
if(l<10)
{
CreateDirectory((sMainPath+sFolderName+named.str()+"-"+ss.str()+"0"+ll.str()).c_str(), NULL);
std::string subFolderName =named.str()+"-"+ss.str()+"0"+ll.str()+"\\";
CreateDirectory((sMainPath+sFolderName).c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence IN\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence OUT\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Fieldreport\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Internal\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Raport\\").c_str(), NULL);
}
else
{
CreateDirectory((sMainPath+sFolderName+named.str()+"-"+ss.str()+ll.str()).c_str(), NULL);
std::string subFolderName =named.str()+"-"+ss.str()+ll.str()+"\\";
CreateDirectory((sMainPath+sFolderName).c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence IN\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Correspondence OUT\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Fieldreport\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Internal\\").c_str(), NULL);
CreateDirectory((sMainPath+sFolderName+subFolderName+"Raport\\").c_str(), NULL);
}
}
}
cout << "\n\n I Made ";
cout << iFolderCount;
cout << " Folders \n\n";
system("PAUSE");
return EXIT_SUCCESS;
}