X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mergefilecommand.cpp;fp=mergefilecommand.cpp;h=0501859e258f82410fa8360ae86092a0b1ea86f6;hb=49d2b7459c5027557564b21e9487dadafbbbdc96;hp=04c92fae9a0d2189cb8f1ed69c9c53572fcfee2e;hpb=ee8403d4eb5760187d62b42a9cf4272de8fc0ec4;p=mothur.git diff --git a/mergefilecommand.cpp b/mergefilecommand.cpp index 04c92fa..0501859 100644 --- a/mergefilecommand.cpp +++ b/mergefilecommand.cpp @@ -41,7 +41,6 @@ string MergeFileCommand::getHelpString(){ exit(1); } } - //********************************************************************************************************************** MergeFileCommand::MergeFileCommand(){ try { @@ -130,29 +129,10 @@ int MergeFileCommand::execute(){ try { if (abort == true) { if (calledHelp) { return 0; } return 2; } - ofstream outputFile; - m->openOutputFile(outputFileName, outputFile); - - char c; - for(int i=0;iopenInputFile(fileNames[i], inputFile); - - while(!inputFile.eof()){ - if (m->control_pressed) { outputTypes.clear(); inputFile.close(); outputFile.close(); m->mothurRemove(outputFileName); return 0; } - - c = inputFile.get(); - //-1 is eof char - if (int(c) != -1) { outputFile << c; } - } - - inputFile.close(); - } - - outputFile.close(); + m->mothurRemove(outputFileName); + for(int i=0;iappendFiles(fileNames[i], outputFileName); } - if (m->control_pressed) { outputTypes.clear(); m->mothurRemove(outputFileName); return 0; } + if (m->control_pressed) { m->mothurRemove(outputFileName); return 0; } m->mothurOutEndLine(); m->mothurOut("Output File Name: "); m->mothurOutEndLine();