if (pid == 0) {
#endif
- ableToOpen = openInputFile(fastaFileNames[i], in);
+ ableToOpen = openInputFile(fastaFileNames[i], in, "noerror");
+
+ //if you can't open it, try default location
+ if (ableToOpen == 1) {
+ if (m->getDefaultPath() != "") { //default path is set
+ string tryPath = m->getDefaultPath() + getSimpleName(fastaFileNames[i]);
+ m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine();
+ ableToOpen = openInputFile(tryPath, in, "noerror");
+ fastaFileNames[i] = tryPath;
+ }
+ }
in.close();
#ifdef USE_MPI
#endif
if (ableToOpen == 1) {
- m->mothurOut(fastaFileNames[i] + " will be disregarded."); m->mothurOutEndLine();
+ m->mothurOut("Unable to open " + fastaFileNames[i] + ". It will be disregarded."); m->mothurOutEndLine();
//erase from file list
fastaFileNames.erase(fastaFileNames.begin()+i);
i--;
string outputFileName = outputDir + getRootName(getSimpleName(fastaFileNames[i])) + "bellerophon.chimeras";
string accnosFileName = outputDir + getRootName(getSimpleName(fastaFileNames[i])) + "bellerophon.accnos";
- bool hasAccnos = true;
chimera->getChimeras();
if (m->control_pressed) { remove(accnosFileName.c_str()); remove(outputFileName.c_str()); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete chimera; return 0; }
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
-
m->mothurOutEndLine(); m->mothurOut("It took " + toString(time(NULL) - start) + " secs to check " + toString(numSeqs) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine();
outputNames.push_back(outputFileName);
- if (hasAccnos) { outputNames.push_back(accnosFileName); }
+ outputNames.push_back(accnosFileName);
delete chimera;
}