Skip to content
Snippets Groups Projects
Commit 46a4624c authored by Nicholas Yang's avatar Nicholas Yang
Browse files

isrword bug

parent 1732c9b2
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -13,7 +13,13 @@ DocumentEnding ISREndDoc::next() {
if(memMap == nullptr) {
string fileName = util::GetCurrentWorkingDir() + pathToIndex + to_string(currentChunk) + ".txt";
currentFile = open(fileName.c_str(), O_RDONLY);
MMDiskHashTable de(util::GetCurrentWorkingDir() + pathToIndex + to_string(currentChunk) + "-seek.txt", 30, 8);
string seekFileName = util::GetCurrentWorkingDir() + pathToIndex + to_string(currentChunk) + "-seek.txt";
if(0 != access(seekFileName.c_str(), 0)) {
DocumentEnding a = DocumentEnding();
a.url = "aaa";
return a;
}
MMDiskHashTable de(seekFileName, 30, 8);
memMap = (char*) mmap(nullptr, util::FileSize(currentFile), PROT_READ, MAP_PRIVATE, currentFile, 0);
memMap += stoll(de.find("=docEnding"));
}
......@@ -24,11 +30,6 @@ DocumentEnding ISREndDoc::next() {
memMap = nullptr;
return DocumentEnding();
}
if(currentChunk == 5) {
DocumentEnding a = DocumentEnding();
a.url = "aaa";
return a;
}
if(*map == '\n') {
memMap = map;
memMap++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment