X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=shhhercommand.cpp;h=be410d9d9f4ecec2fc885a239c9ba57b5f409e89;hb=a5d3e10e24e503483d8e85b54f0fd34b9308d31b;hp=5bcd7d843a18829793afcc9660af7b7667385c4b;hpb=ffc44592ff7ae94f14f9e21f87198e33d323cd1d;p=mothur.git diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 5bcd7d8..be410d9 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -150,14 +150,21 @@ ShhherCommand::ShhherCommand(string option) { else{ ofstream temp; - string thisoutputDir = m->hasPath(flowFilesFileName); //if user entered a file with a path then preserve it + string thisoutputDir = outputDir; + if (outputDir == "") { thisoutputDir = m->hasPath(flowFilesFileName); } //if user entered a file with a path then preserve it - //flow.files = 9 character offset - compositeFASTAFileName = thisoutputDir + m->getRootName(m->getSimpleName(flowFilesFileName)) + "shhh.fasta"; + //we want to rip off .files, and also .flow if its there + string fileroot = m->getRootName(m->getSimpleName(flowFilesFileName)); + if (fileroot[fileroot.length()-1] == '.') { fileroot = fileroot.substr(0, fileroot.length()-1); } //rip off dot + string extension = m->getExtension(fileroot); + if (extension == ".flow") { fileroot = m->getRootName(fileroot); } + else { fileroot += "."; } //add back if needed + + compositeFASTAFileName = thisoutputDir + fileroot + "shhh.fasta"; m->openOutputFile(compositeFASTAFileName, temp); temp.close(); - compositeNamesFileName = thisoutputDir + m->getRootName(m->getSimpleName(flowFilesFileName)) + "shhh.names"; + compositeNamesFileName = thisoutputDir + fileroot + "shhh.names"; m->openOutputFile(compositeNamesFileName, temp); temp.close(); }