cerr << "Decompressing " << completeFileName << " via temporary named pipe " << tempName << "\n";
system(command.c_str());
cerr << "Done decompressing " << completeFileName << "\n";
- remove(tempName.c_str());
+ mothurRemove(tempName);
exit(EXIT_SUCCESS);
} else {
cerr << "waiting on child process " << fork_result << "\n";
cerr << "Decompressing " << completeFileName << " via temporary named pipe " << tempName << "\n";
system(command.c_str());
cerr << "Done decompressing " << completeFileName << "\n";
- remove(tempName.c_str());
+ mothurRemove(tempName);
exit(EXIT_SUCCESS);
} else {
cerr << "waiting on child process " << fork_result << "\n";
string command = "mv " + oldName + " " + newName;
system(command.c_str());
#else
- remove(newName.c_str());
+ m->mothurRemove(newName);
int renameOk = rename(oldName.c_str(), newName.c_str());
#endif
return 0;
output.close();
//remove temp files
- remove(tempDistFile.c_str());
- remove(tempOutfile.c_str());
+ mothurRemove(tempDistFile);
+ mothurRemove(tempOutfile);
#endif
return outfile;
exit(1);
}
}
+/***********************************************************************/
+void MothurOut::mothurRemove(string filename){
+ try {
+ filename = getFullPathName(filename);
+ remove(filename.c_str());
+ }
+ catch(exception& e) {
+ errorOut(e, "MothurOut", "mothurRemove");
+ exit(1);
+ }
+}
/**************************************************************************************************/
vector<vector<double> > MothurOut::binomial(int maxOrder){