Aloha,
I'm attempting to use a C program to create directories and then use a system call to have another program write .dat files into that directory. I understand that I could use the "system("mkdir directory_name")" function however, I would like my program to create a new directory each time the program loops by incrementing an integer contained in the file name each loop. Here are some example directory names: A1, A2, A3, A4, A5...
I know that this isn't the proper use of the system function, but below is some code that might better illustrate what im trying to do.
main()
{
int i;
for(i=0;i<5;i++)
system("mkdir A%d",i);
}
I also don't mind using a string of characters in an array that I would modify each time I pass through the loop and use as the directory's name.
Does anyone know of a simple way to have a C program create unique directories each time it passes through a loop, by incrementing an integer contained in the file name?
Mahalo,
Windell