I've got a problem with merging files. I don't know how to join files like: *.001, *.002 etc. from (for example) Total Commander using C++. Have you hot any ideas or suggestions?
Printable View
I've got a problem with merging files. I don't know how to join files like: *.001, *.002 etc. from (for example) Total Commander using C++. Have you hot any ideas or suggestions?
These files should just be cuts of a larger file. In other words, begin with file 001 and write its contents to a new file called "assembledfile" for example. Then read the 002 file and append its contents to the "assembledfile" file.
In pseudocode:
Code:
int filecount = someFunctionToCalculateTheFileCount(); assembled.open(writeonly); //Check for errors too if the file is open proceed: for (int i = 0; i < filecount; ++i) { file.open(readonly) //Do some error checking too if the file is open read all its contents and write it to the assembled file. You might want to use a data stream if the files are binary!!! file.close(); } assembled.close();