X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.cpp;h=45d1176f9ddafeee56b219529efed45ea3d19d02;hb=8c8acb6218f58f662466e4111ab8aa4da0caf93c;hp=c80bff27e4ab69bf26d0fddaae534fe625f6df0b;hpb=d0cceb86216f1174afa51582a51490294912b00e;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index c80bff2..45d1176 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -958,7 +958,7 @@ int MothurOut::openOutputFile(string fileName, ofstream& fileHandle){ } /**************************************************************************************************/ -void MothurOut::appendFiles(string temp, string filename) { +int MothurOut::appendFiles(string temp, string filename) { try{ ofstream output; ifstream input; @@ -968,15 +968,18 @@ void MothurOut::appendFiles(string temp, string filename) { int ableToOpen = openInputFile(temp, input, "no error"); //int ableToOpen = openInputFile(temp, input); + int numLines = 0; if (ableToOpen == 0) { //you opened it while(char c = input.get()){ if(input.eof()) { break; } - else { output << c; } + else { output << c; if (c == '\n') {numLines++;} } } input.close(); } output.close(); + + return numLines; } catch(exception& e) { errorOut(e, "MothurOut", "appendFiles");