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:
int filecount = someFunctionToCalculateTheFileCount();
QFile assembled
(fileName
);
assembled.open(writeonly); //Check for errors too
if the file is open proceed:
for (int i = 0; i < filecount; ++i) {
QFile file(fileNameBasedOnIteration
);
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();
int filecount = someFunctionToCalculateTheFileCount();
QFile assembled(fileName);
assembled.open(writeonly); //Check for errors too
if the file is open proceed:
for (int i = 0; i < filecount; ++i) {
QFile file(fileNameBasedOnIteration);
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();
To copy to clipboard, switch view to plain text mode
Bookmarks