I'm attempting to create a dynamic value within a string.
In the below code line: char new_dir[] = "c:\\xyz";
I'd like to create a random number and use a parameter to replace xyz
,
this will allow random folder creation.
Any help is appreciated!
char filename[1024], command[1024];
char new_dir[] = "C:\\xyz";
if (mkdir(new_dir))
lr_output_message ("Create directory %s failed", new_dir);
else
lr_output_message ("Created new directory %s", new_dir);
sprintf(filename, "%s\\%s", new_dir, "newfile.txt");
sprintf(command, "dir /b c:\\ > %s /w", filename);
system(command);
lr_output_message ("Created new file %s", filename);