X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothur.cpp;h=0249f6518cc08b7c902f598365739fc2bdeb032f;hb=62568a297aaf939ab753334f17abde82ec8e8531;hp=cb72ac635299285b9fe0775833e6fed18ae1369d;hpb=e189982e0a9b7352ad57cc38ccee675f128be22e;p=mothur.git diff --git a/mothur.cpp b/mothur.cpp index cb72ac6..0249f65 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]){ m->mothurOutEndLine(); m->mothurOutEndLine(); #else m->mothurOutJustToLog("Linux version"); - >m->mothurOutEndLine(); m->mothurOutEndLine(); + m->mothurOutEndLine(); m->mothurOutEndLine(); #endif #else @@ -73,9 +73,9 @@ int main(int argc, char *argv[]){ #endif //header - m->mothurOut("mothur v.1.9"); + m->mothurOut("mothur v.1.10.2"); m->mothurOutEndLine(); - m->mothurOut("Last updated: 4/09/2010"); + m->mothurOut("Last updated: 5/26/2010"); m->mothurOutEndLine(); m->mothurOutEndLine(); m->mothurOut("by"); @@ -144,15 +144,37 @@ int main(int argc, char *argv[]){ while(bail == 0) { bail = mothur->getInput(); } - string outputDir = mothur->getOutputDir(); - string newlogFileName = outputDir + logFileName; - //closes logfile so we can rename m->closeLog(); - - //need this because m->mothurOut makes the logfile, but doesn't know where to put it - rename(logFileName.c_str(), newlogFileName.c_str()); //logfile with timestamp + string outputDir = mothur->getOutputDir(); + string tempLog = mothur->getLogFileName(); + bool append = mothur->getAppend(); + + string newlogFileName; + if (tempLog != "") { + newlogFileName = outputDir + tempLog; + + if (!append) { + //need this because m->mothurOut makes the logfile, but doesn't know where to put it + rename(logFileName.c_str(), newlogFileName.c_str()); //logfile with timestamp + + }else { + ofstream outNewLog; + openOutputFileAppend(newlogFileName, outNewLog); + outNewLog << endl << endl << "*********************************************************************************" << endl << endl; + outNewLog.close(); + + appendFiles(logFileName, newlogFileName); + remove(logFileName.c_str()); + } + }else{ + newlogFileName = outputDir + logFileName; + //need this because m->mothurOut makes the logfile, but doesn't know where to put it + rename(logFileName.c_str(), newlogFileName.c_str()); //logfile with timestamp + } + + delete mothur; #ifdef USE_MPI