]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.cpp
added distance search method to classify.seqs
[mothur.git] / mothur.cpp
index 1c0c98f9f1caf4cec5de25f4c66ce7f9a3a3af8f..bd7ab728c76d311ffe0dc7dcc052a026cfa6e741 100644 (file)
 /**************************************************************************************************/
 
 GlobalData* GlobalData::_uniqueInstance = 0;
+CommandFactory* CommandFactory::_uniqueInstance = 0;
 
 int main(int argc, char *argv[]){
        try {
                
-               //remove old logfile
-               string logFileName = "mothur.logFile";
-               remove(logFileName.c_str());
+               string log = "mothur.logFile";
+               remove(log.c_str());
+               
+               time_t ltime = time(NULL); /* calendar time */  
+               string logFileName = "mothur." + toString(ltime) + ".logfile";
                
                //version
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
@@ -41,9 +44,9 @@ int main(int argc, char *argv[]){
 
                
                //header
-               mothurOut("mothur v.1.7.0");
+               mothurOut("mothur v.1.7.2");
                mothurOutEndLine();             
-               mothurOut("Last updated: 11/23/2009");
+               mothurOut("Last updated: 12/04/2009");
                mothurOutEndLine();     
                mothurOutEndLine();             
                mothurOut("by");
@@ -77,7 +80,7 @@ int main(int argc, char *argv[]){
                                
                //srand(54321);
                srand( (unsigned)time( NULL ) );
-
+               
                Engine* mothur;
                bool bail = 0;
                string input;
@@ -92,13 +95,19 @@ int main(int argc, char *argv[]){
                        }
                }
                else{
-                       mothur = new InteractEngine(argv[0]);           
+                       mothur = new InteractEngine(argv[0]);   
                }
-
+               
                while(bail == 0)                {       bail = mothur->getInput();                      }
+               
+               string outputDir = mothur->getOutputDir();
+               logFileName = outputDir + logFileName;
        
+               //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) {