diff --git a/indexer/Indexer.cpp b/indexer/Indexer.cpp index e573a710d7604db463d0787fad8b885a5647355d..10cf4940106586901a699aa8cc7f859e87ff0d2d 100644 --- a/indexer/Indexer.cpp +++ b/indexer/Indexer.cpp @@ -85,9 +85,9 @@ void Indexer::save() { } else { seeker[word.first] = seekOffset; } - string wordBreak = word.first + "\n"; - write(file, wordBreak.c_str(), strlen(wordBreak.c_str())); - seekOffset += strlen(wordBreak.c_str()); +// string wordBreak = word.first + "\n"; +// write(file, wordBreak.c_str(), strlen(wordBreak.c_str())); +// seekOffset += strlen(wordBreak.c_str()); for(auto location : word.second) { string locationSpace = to_string(location) + " "; write(file, locationSpace.c_str(), strlen(locationSpace.c_str())); diff --git a/indexer/SeekFileTests.cpp b/indexer/SeekFileTests.cpp index 8493a252622e36837106814eba7ebe4bc28eb8e4..ba0ba938b3758093d167bacc3a86954719ad3527 100644 --- a/indexer/SeekFileTests.cpp +++ b/indexer/SeekFileTests.cpp @@ -10,9 +10,9 @@ using namespace std; int main() { int index1 = open("index0.txt", O_CREAT|O_RDWR, S_IRWXU); - lseek(index1, 129545, SEEK_SET); + lseek(index1, 129522, SEEK_SET); char buffer[10]; - if(read(index1, buffer, 20) != 20) { + if(read(index1, buffer, 10) != 10) { cout << "ERROR" << endl; } cout << buffer << endl;