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