]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.cpp
added distance search method to classify.seqs
[mothur.git] / mothur.cpp
index 7fd5d1e48fc25bee4af0aefa7213814695489cf2..bd7ab728c76d311ffe0dc7dcc052a026cfa6e741 100644 (file)
@@ -19,12 +19,11 @@ CommandFactory* CommandFactory::_uniqueInstance = 0;
 int main(int argc, char *argv[]){
        try {
                
-               //remove old logfile
                string log = "mothur.logFile";
                remove(log.c_str());
                
                time_t ltime = time(NULL); /* calendar time */  
-               string logFileName = "mothur." + toString(asctime( localtime(&ltime) )) + ".logfile";
+               string logFileName = "mothur." + toString(ltime) + ".logfile";
                
                //version
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
@@ -99,19 +98,16 @@ int main(int argc, char *argv[]){
                        mothur = new InteractEngine(argv[0]);   
                }
                
-               //used to intercept the terminate signal, so instead of terminating mothur it will end a command
-               //void (*prev_fn)(int);
-               //prev_fn = signal(SIGTERM, mothur->terminateCommand(0));
-               
-               //if (prev_fn==SIG_IGN) signal (SIGTERM,SIG_IGN);
-
-               
                while(bail == 0)                {       bail = mothur->getInput();                      }
-       
-               delete mothur;
                
+               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) {