]> git.donarmstrong.com Git - mothur.git/blobdiff - reversecommand.cpp
added checks for ^C to quit command instead of program
[mothur.git] / reversecommand.cpp
index 4efcbcce17e7daeb102a3c3c98d4baedbc185093..114750e71e4c5cb127cf4b9407bd1841bb8aa622 100644 (file)
@@ -103,6 +103,8 @@ int ReverseSeqsCommand::execute(){
                openOutputFile(reverseFile, outFASTA);
                
                while(!inFASTA.eof()){
+                       if (m->control_pressed) {  inFASTA.close();  outFASTA.close(); remove(reverseFile.c_str()); return 0; }
+                        
                        Sequence currSeq(inFASTA);  gobble(inFASTA);
                        if (currSeq.getName() != "") {
                                currSeq.reverseComplement();
@@ -112,6 +114,8 @@ int ReverseSeqsCommand::execute(){
                inFASTA.close();
                outFASTA.close();
                
+               if (m->control_pressed) {  remove(reverseFile.c_str()); return 0; }
+               
                m->mothurOutEndLine();
                m->mothurOut("Output File Name: "); m->mothurOutEndLine();
                m->mothurOut(reverseFile); m->mothurOutEndLine();