Method: Bio::FlatFileIndex::Indexer.makeindexBDB

Defined in:
lib/bio/io/flatfile/indexer.rb

.makeindexBDB(name, parser, options, *files) ⇒ Object

module Parser



451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/bio/io/flatfile/indexer.rb', line 451

def self.makeindexBDB(name, parser, options, *files)
  # options are not used in this method
  unless defined?(BDB)
    raise RuntimeError, "Berkeley DB support not found"
  end
  DEBUG.print "makeing BDB DataBank...\n"
  db = DataBank.new(name, MAGIC_BDB)
  db.format = parser.format
  db.fileids.add(*files)
  db.fileids.recalc

  db.primary = parser.primary.name
  db.secondary = parser.secondary.names

  DEBUG.print "writing config.dat, config, fileids ...\n"
  db.write('wb', BDBdefault::flag_write)

  DEBUG.print "reading files...\n"

  addindex_bdb(db, BDBdefault::flag_write, (0...(files.size)),
               parser, options)
  db.close
  true
end