def open
      begin
        if File.exist?(@file_name)
          @f = File.open(@file_name, 'rb+')
        else
          @f = File.open(@file_name, 'wb+')
        end
      rescue => e
        PEROBS.log.fatal "Cannot open stack file #{@file_name}: #{e.message}"
      end
      unless @f.flock(File::LOCK_NB | File::LOCK_EX)
        PEROBS.log.fatal 'Database stack file is locked by another process'
      end
    end
def open
      begin
        if File.exist?(@file_name)
          @f = File.open(@file_name, 'rb+')
        else
          @f = File.open(@file_name, 'wb+')
        end
      rescue => e
        PEROBS.log.fatal "Cannot open stack file #{@file_name}: #{e.message}"
      end
      unless @f.flock(File::LOCK_NB | File::LOCK_EX)
        PEROBS.log.fatal 'Database stack file is locked by another process'
      end
    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 entry_bytes [Integer] Number of bytes each entry must have
 Open the stack file.