X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=filterseqscommand.cpp;h=b9436f8078df0da22408dafc889d16e62d8a7d6c;hb=bdb5d82e2a73829b4e1fa42656ad9bcb57e3e948;hp=c463cd294d04dcdc31e1a6891db1659db45dc05e;hpb=8bc3e5b38c2317a1715f53be22fa96455868c281;p=mothur.git diff --git a/filterseqscommand.cpp b/filterseqscommand.cpp index c463cd2..b9436f8 100644 --- a/filterseqscommand.cpp +++ b/filterseqscommand.cpp @@ -25,6 +25,7 @@ vector FilterSeqsCommand::getValidParameters(){ //********************************************************************************************************************** FilterSeqsCommand::FilterSeqsCommand(){ try { + abort = true; //initialize outputTypes vector tempOutNames; outputTypes["fasta"] = tempOutNames; @@ -132,7 +133,9 @@ FilterSeqsCommand::FilterSeqsCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastafileNames[i]); m->mothurOut("Unable to open " + fastafileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastafileNames[i] = tryPath; } } @@ -142,7 +145,9 @@ FilterSeqsCommand::FilterSeqsCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastafileNames[i]); m->mothurOut("Unable to open " + fastafileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastafileNames[i] = tryPath; } } @@ -605,7 +610,11 @@ int FilterSeqsCommand::createProcessesRunFilter(string F, string filename) { out.close(); exit(0); - }else { m->mothurOut("unable to spawn the necessary processes."); m->mothurOutEndLine(); exit(0); } + }else { + m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine(); + for (int i = 0; i < processIDS.size(); i++) { kill (processIDS[i], SIGINT); } + exit(0); + } } //force parent to wait until all the processes are done @@ -969,7 +978,11 @@ int FilterSeqsCommand::createProcessesCreateFilter(Filters& F, string filename) out.close(); exit(0); - }else { m->mothurOut("unable to spawn the necessary processes."); m->mothurOutEndLine(); exit(0); } + }else { + m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine(); + for (int i = 0; i < processIDS.size(); i++) { kill (processIDS[i], SIGINT); } + exit(0); + } } //parent do your part