]> git.donarmstrong.com Git - mothur.git/blobdiff - mergefilecommand.cpp
added checks for ^C to quit command instead of program
[mothur.git] / mergefilecommand.cpp
index 7e17b051305014e2aa58831fddfabaad63f319d4..a076281035ff08fdb2ba0af591dce24f726cd636 100644 (file)
@@ -97,6 +97,8 @@ int MergeFileCommand::execute(){
                        openInputFile(fileNames[i], inputFile);
                        
                        while(!inputFile.eof()){        
+                               if (m->control_pressed) { inputFile.close(); outputFile.close(); remove(outputFileName.c_str()); return 0;  }
+                       
                                c = inputFile.get(); 
                                //-1 is eof char
                                if (int(c) != -1) { outputFile << c; }   
@@ -107,6 +109,8 @@ int MergeFileCommand::execute(){
                
                outputFile.close();
                
+               if (m->control_pressed) { remove(outputFileName.c_str()); return 0;  }
+               
                m->mothurOutEndLine();
                m->mothurOut("Output File Name: "); m->mothurOutEndLine();
                m->mothurOut(outputFileName); m->mothurOutEndLine();