Method: Bio::FlatFileIndex::DataBank#write

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

#write(mode = 'wb', *bdbarg) ⇒ Object



1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
# File 'lib/bio/io/flatfile/index.rb', line 1216

def write(mode = 'wb', *bdbarg)
  unless FileTest.directory?(@dbname) then
    Dir.mkdir(@dbname)
  end
  f = File.open(self.class.filename(@dbname), mode)
  f.write self.to_s
  f.close

  if @bdb then
    bdb_open(*bdbarg)
    @config['format'] = format
    @config['primary_namespace'] = @primary.name
    @config['secondary_namespaces'] = @secondary.names.join("\t")
    @bdb_fileids.writeback_array('', fileids, *bdbarg)
  end
  true
end