0

I am writing a simple application where I want to put Files into specific files. Example:

/FolderA/abc123.txt
/FolderA/def123.txt
/FolderB/qwe666.txt

What I am trying to do, is create Folder A within a root directory (where the application is run from). How would I navigate to each of these folders and then manipulate these files?

    setDrawID(1245); 

char buf[64];
memset(buf, 0, sizeof(char)*64);
/*Get the directory from where the Application is running. 
Witin that folder There should be a DrawsFolder within that Folder
Create a New folder with the ID of the Draw.
*/
sprintf(buf, system("dir") + "\Draws\\%d", getDrawID());
cout << buf << endl;

int x =  mkdir(buf);
cout << x;

This code works, however - How Would I navigate to a folder with a variable name? Thanks,

KingJohnno
  • 602
  • 2
  • 12
  • 31

0 Answers0