Copy one file to multiple files with same name
Hey guys.
I'm coding a file manager and I want to open one file and create a x amount of copies from the original file, all those copies in the same directory and name (putting just a counter in the end).
Example of what I want:
Original file: Test.txt
Amount of Copies: 5
Copied Files: Test1.txt, Test2.txt, Test3.txt, Test4.txt, Test5.txt
But I just can do like this:
Original file: Test.txt
Amount of Copies: 5
Copied Files: Test.txt1, Test.txt2, Test.txt3, Test.txt4, Test.txt5
To do the way I'm doing, I'm using sprintf(Filename, "%s%d", argv[3], I);
I've tried using strtok to separate the string using "." as separator, but it gave me Test.1txt as result.
Please, anyone can help me?