X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.cpp;fp=mothurout.cpp;h=0efa551565c6e18001cd6ed53e0643a50f525f37;hb=2cfb747aa8f63bde9c1114001e6d2e81ccd26178;hp=8892febb384cbb07233858f2c6b608f8153ca09f;hpb=4a760c2d164aa955dee7d3d38da323822763d906;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index 8892feb..0efa551 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -1296,15 +1296,15 @@ vector MothurOut::setFilePosFasta(string filename, int& num) char c = inFASTA.get(); count++; if (c == '>') { positions.push_back(count-1); - //cout << count << endl; + if (debug) { mothurOut("[DEBUG]: numSeqs = " + toString(positions.size()) + " count = " + toString(count) + ".\n"); } } } inFASTA.close(); num = positions.size(); - - /*FILE * pFile; - long size; + if (debug) { mothurOut("[DEBUG]: num = " + toString(num) + ".\n"); } + FILE * pFile; + unsigned long long size; //get num bytes in file pFile = fopen (filename.c_str(),"rb"); @@ -1313,9 +1313,9 @@ vector MothurOut::setFilePosFasta(string filename, int& num) fseek (pFile, 0, SEEK_END); size=ftell (pFile); fclose (pFile); - }*/ + } - unsigned long long size = positions[(positions.size()-1)]; + /*unsigned long long size = positions[(positions.size()-1)]; ifstream in; openInputFile(filename, in); @@ -1325,8 +1325,10 @@ vector MothurOut::setFilePosFasta(string filename, int& num) if(in.eof()) { break; } else { size++; } } - in.close(); - + in.close();*/ + + if (debug) { mothurOut("[DEBUG]: size = " + toString(size) + ".\n"); } + positions.push_back(size); positions[0] = 0;