X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=degapseqscommand.cpp;fp=degapseqscommand.cpp;h=8f8a5c3901d845b27cdbeb5a3f0c34df0b587ce2;hb=80c3fe03a8fd1635d3ad7918ff00beb973449f50;hp=c6c4b5521fe35fa1984ecb56229a33c6c58c8163;hpb=dfae916a398508554d35c6b3c8002b69becb53be;p=mothur.git diff --git a/degapseqscommand.cpp b/degapseqscommand.cpp index c6c4b55..8f8a5c3 100644 --- a/degapseqscommand.cpp +++ b/degapseqscommand.cpp @@ -54,11 +54,21 @@ DegapSeqsCommand::DegapSeqsCommand(string option) { } ifstream in; - int ableToOpen = openInputFile(fastaFileNames[i], in); + int 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(); 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--;