def open
      begin
        if File.exist?(@file_name)
          # Open an existing file.
          @f = File.open(@file_name, 'rb+')
          read_header
        else
          # Create a new file by writing a new header.
          @f = File.open(@file_name, 'wb+')
          write_header
        end
      rescue IOError => e
        PEROBS.log.fatal "Cannot open blob file #{@file_name}: #{e.message}"
      end
      unless @f.flock(File::LOCK_NB | File::LOCK_EX)
        PEROBS.log.fatal 'Database blob file is locked by another process'
      end
      @f.sync = true
    end
def open
      begin
        if File.exist?(@file_name)
          # Open an existing file.
          @f = File.open(@file_name, 'rb+')
          read_header
        else
          # Create a new file by writing a new header.
          @f = File.open(@file_name, 'wb+')
          write_header
        end
      rescue IOError => e
        PEROBS.log.fatal "Cannot open blob file #{@file_name}: #{e.message}"
      end
      unless @f.flock(File::LOCK_NB | File::LOCK_EX)
        PEROBS.log.fatal 'Database blob file is locked by another process'
      end
      @f.sync = true
    end
Create a new stack file in the given directory with the given file name.
 @param dir [String] Directory
 @param name [String] File name
 @param progressmeter [ProgressMeter] Reference to a progress meter
        object
 @param entry_bytes [Integer] Number of bytes each entry must have
 @param first_entry_default [Integer] Default address of the first blob
 Open the blob file.