X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothur.cpp;h=bd7ab728c76d311ffe0dc7dcc052a026cfa6e741;hb=c3f0a9c8f932b923f3a6fbbf143e8f4b85fd6f5f;hp=d4177e3368be8d836374e935b9e884d6ff26c5f4;hpb=315e38cf393c82be238da5b32574f225a020d25c;p=mothur.git diff --git a/mothur.cpp b/mothur.cpp index d4177e3..bd7ab72 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -19,9 +19,8 @@ CommandFactory* CommandFactory::_uniqueInstance = 0; int main(int argc, char *argv[]){ try { - //remove old logfile -// string log = "mothur.logFile"; -// remove(log.c_str()); + string log = "mothur.logFile"; + remove(log.c_str()); time_t ltime = time(NULL); /* calendar time */ string logFileName = "mothur." + toString(ltime) + ".logfile"; @@ -104,10 +103,11 @@ int main(int argc, char *argv[]){ string outputDir = mothur->getOutputDir(); logFileName = outputDir + logFileName; - delete mothur; - -// rename(log.c_str(), logFileName.c_str()); //logfile with timestamp + //need this because mothur.h makes the logfile, but doesn't know where to put it + rename(log.c_str(), logFileName.c_str()); //logfile with timestamp + delete mothur; + return 0; } catch(exception& e) {