]> git.donarmstrong.com Git - mothur.git/blobdiff - getgroupcommand.cpp
done testing 1.13.0
[mothur.git] / getgroupcommand.cpp
index b645517f938928c44eb5faa5871e4171c40fb800..cf47661bb6a8084740262d8a6b4b157181a2b0ab 100644 (file)
@@ -40,12 +40,12 @@ GetgroupCommand::GetgroupCommand(string option)  {
                        if (abort == false) {
                                //open shared file
                                sharedfile = globaldata->getSharedFile();
-                               openInputFile(sharedfile, in);
+                               m->openInputFile(sharedfile, in);
                
                                //open output file
-                               if (outputDir == "") { outputDir += hasPath(sharedfile); }
-                               outputFile = outputDir + getRootName(getSimpleName(sharedfile)) + "bootGroups";
-                               openOutputFile(outputFile, out);
+                               if (outputDir == "") { outputDir += m->hasPath(sharedfile); }
+                               outputFile = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "bootGroups";
+                               m->openOutputFile(outputFile, out);
 
                        }
                }
@@ -102,10 +102,14 @@ int GetgroupCommand::execute(){
                        in >> inputData;
                }
                
+               if (m->control_pressed) { in.close();  out.close(); remove(outputFile.c_str());   return 0; }
+
                if (in.eof() != true) { in >> nextLabel; }
                
                //read the rest of the groups info in
                while ((nextLabel == holdLabel) && (in.eof() != true)) {
+                       if (m->control_pressed) { in.close();  out.close(); remove(outputFile.c_str());   return 0; }
+                       
                        in >> groupN >> num;
                        count++;
                        
@@ -124,6 +128,8 @@ int GetgroupCommand::execute(){
                in.close();
                out.close();
                
+               if (m->control_pressed) {  remove(outputFile.c_str());   return 0; }
+               
                m->mothurOutEndLine();
                m->mothurOut("Output File Name: "); m->mothurOutEndLine();
                m->mothurOut(outputFile); m->mothurOutEndLine();