def open(filename)
      # Get header & check.
      @filename = filename
      @file     = fileOpen(@filename)
      @header   = OpenStruct.new(DBHEADER.decode(@file.read(SIZEOF_DBHEADER)))
      @pageSize = @header.page_size
      @npages   = fileSize / @pageSize

      raise "#{@filename} is not a SQLite3 Database."                                 if @header.magic != "SQLite format 3\000"
      raise "#{@filename} is corrupt -- has incomplete pages (pagesize=#{@pageSize})" if (@pageSize * @npages) != fileSize
    end
def open(filename)
      # Get header & check.
      @filename = filename
      @file     = fileOpen(@filename)
      @header   = OpenStruct.new(DBHEADER.decode(@file.read(SIZEOF_DBHEADER)))
      @pageSize = @header.page_size
      @npages   = fileSize / @pageSize

      raise "#{@filename} is not a SQLite3 Database."                                 if @header.magic != "SQLite format 3\000"
      raise "#{@filename} is corrupt -- has incomplete pages (pagesize=#{@pageSize})" if (@pageSize * @npages) != fileSize
    end
Open the database