X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=formatcolumn.cpp;h=6b29f90464f3259c6c625421d9ee1cadbc8b2ef8;hb=01f8d2c7d982a6209211f5abbcf2a086fdf60d0a;hp=4ce73b33186425cc9cb62add6258fe9663328513;hpb=5cc45e630ccee2c3503e1bfe7e9b3524898cef8a;p=mothur.git diff --git a/formatcolumn.cpp b/formatcolumn.cpp index 4ce73b3..6b29f90 100644 --- a/formatcolumn.cpp +++ b/formatcolumn.cpp @@ -39,7 +39,7 @@ int FormatColumnMatrix::read(NameAssignment* nameMap){ while(fileHandle && lt == 1){ //let's assume it's a triangular matrix... - if (m->control_pressed) { out.close(); remove(tempOutFile.c_str()); fileHandle.close(); delete reading; return 0; } + if (m->control_pressed) { out.close(); m->mothurRemove(tempOutFile); fileHandle.close(); delete reading; return 0; } fileHandle >> firstName >> secondName >> distance; // get the row and column names and distance @@ -82,7 +82,7 @@ int FormatColumnMatrix::read(NameAssignment* nameMap){ string outfile = m->getRootName(squareFile) + "sorted.dist.temp"; //use the unix sort - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) string command = "sort -n " + squareFile + " -o " + outfile; system(command.c_str()); #else //sort using windows sort @@ -90,7 +90,7 @@ int FormatColumnMatrix::read(NameAssignment* nameMap){ system(command.c_str()); #endif - if (m->control_pressed) { remove(tempOutFile.c_str()); remove(outfile.c_str()); delete reading; return 0; } + if (m->control_pressed) { m->mothurRemove(tempOutFile); m->mothurRemove(outfile); delete reading; return 0; } //output to new file distance for each row and save positions in file where new row begins ifstream in; @@ -115,7 +115,7 @@ int FormatColumnMatrix::read(NameAssignment* nameMap){ while(!in.eof()) { - if (m->control_pressed) { in.close(); out.close(); remove(distFile.c_str()); remove(tempOutFile.c_str()); remove(outfile.c_str()); delete reading; return 0; } + if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(distFile); m->mothurRemove(tempOutFile); m->mothurRemove(outfile); delete reading; return 0; } in >> first >> second >> dist; m->gobble(in); @@ -159,17 +159,17 @@ int FormatColumnMatrix::read(NameAssignment* nameMap){ in.close(); out.close(); - if (m->control_pressed) { remove(distFile.c_str()); remove(tempOutFile.c_str()); remove(outfile.c_str()); delete reading; return 0; } + if (m->control_pressed) { m->mothurRemove(distFile); m->mothurRemove(tempOutFile); m->mothurRemove(outfile); delete reading; return 0; } - remove(tempOutFile.c_str()); - remove(outfile.c_str()); + m->mothurRemove(tempOutFile); + m->mothurRemove(outfile); reading->finish(); delete reading; list->setLabel("0"); - if (m->control_pressed) { remove(distFile.c_str()); return 0; } + if (m->control_pressed) { m->mothurRemove(distFile); return 0; } return 1;