Method: Bio::FlatFileIndex.open

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

.open(name) ⇒ Object

Opens existing databank. Databank is a directory which contains indexed files and configuration files. The type of the databank (flat or BerkeleyDB) are determined automatically.

If block is given, the databank object is passed to the block. The databank will be automatically closed when the block terminates.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/bio/io/flatfile/index.rb', line 88

def self.open(name)
  if block_given? then
    begin
      i = self.new(name)
      r = yield i
    ensure
      if i then
        begin
          i.close
        rescue IOError
        end
      end
    end
  else
    r = self.new(name)
  end
  r
end