Hello :-)
I'm an engineer (mechanic) so Cprogramming is not my job, and my question can sound silly
to most of you. Please understand and thank you in advance.
My problem is:
I get a FileList.txt on argv[1], for example:
C:\F00\Pippo_Folder\Pippo_Data\PippoData001.dat
C:\F00\Robin_Folder\Robin_Data\RobinData005.dat
C:\F00\Batman_Folder\Batman_Data\BatmanData100.dat
etc..
I want to fopen(_argv[1],"r") then fopen(first_file,"rb"); and that's OK, I can do that.
My problem is that after reading the file I need to create a NewFile.dat with the same name
and "same Path" but to a new folder, for example i need this kind of output:
C:\F01\Pippo_Folder\Pippo_Data\PippoData001.dat
C:\F01\Robin_Folder\Robin_Data\RobinData005.dat
C:\F01\Batman_Folder\Batman_Data\BatmanData100.dat
(note F00 changed to F01..)
of course when i try to fopen(NewFile_in_NewPath,"wb") i get my warning
"cannot open file.." .. beacuse the NewPath doesn't exist yet.(I think)
So i tried to use the function mkdir(const char *path) but i cant get it right
It seem not so easy( to me ) to automatically create folders from C code.
Any tips ?
ThankYou Paolo