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:
Qt Code:
  1. int filecount = someFunctionToCalculateTheFileCount();
  2. QFile assembled(fileName);
  3. assembled.open(writeonly); //Check for errors too
  4.  
  5. if the file is open proceed:
  6.  
  7. for (int i = 0; i < filecount; ++i) {
  8. QFile file(fileNameBasedOnIteration);
  9. file.open(readonly) //Do some error checking too
  10.  
  11. 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!!!
  12.  
  13. file.close();
  14. }
  15. assembled.close();
To copy to clipboard, switch view to plain text mode