Skip to content

Commit

Permalink
[FIX] detect old(unsupported) indexes and fail
Browse files Browse the repository at this point in the history
  • Loading branch information
h-2 committed Oct 21, 2015
1 parent 67d32c1 commit 8ef1177
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lambda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@ loadDbIndexFromDisk(TGlobalHolder & globalHolder,
path += ".fm";
else
path += ".sa";

// Check if the index is of the old format (pre 0.9.0)
if (fileExists(toCString(path + ".txt.concat"))) // these files are not written anymore
{
std::cerr << ((options.verbosity == 0) ? strIdent : std::string())
<< " failed.\n"
<< "It appears you tried to open an old index (created before 0.9.0) which "
<< "is not supported. Please remove the old files and create a new index with lambda_indexer!\n";
return 1;
}

int ret = open(globalHolder.dbIndex, path.c_str());
if (ret != true)
{
Expand Down

0 comments on commit 8ef1177

Please sign in to comment.