Skip to content

Commit 8ef1177

Browse files
committed
[FIX] detect old(unsupported) indexes and fail
1 parent 67d32c1 commit 8ef1177

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/lambda.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,17 @@ loadDbIndexFromDisk(TGlobalHolder & globalHolder,
252252
path += ".fm";
253253
else
254254
path += ".sa";
255+
256+
// Check if the index is of the old format (pre 0.9.0)
257+
if (fileExists(toCString(path + ".txt.concat"))) // these files are not written anymore
258+
{
259+
std::cerr << ((options.verbosity == 0) ? strIdent : std::string())
260+
<< " failed.\n"
261+
<< "It appears you tried to open an old index (created before 0.9.0) which "
262+
<< "is not supported. Please remove the old files and create a new index with lambda_indexer!\n";
263+
return 1;
264+
}
265+
255266
int ret = open(globalHolder.dbIndex, path.c_str());
256267
if (ret != true)
257268
{

0 commit comments

Comments
 (0)