def close
      begin
        @f.flush
        @f.flock(File::LOCK_UN)
        @f.close
      rescue IOError => e
        PEROBS.log.fatal "Cannot close stack file #{@file_name}: #{e.message}"
      end
    end
def close
      begin
        @f.flush
        @f.flock(File::LOCK_UN)
        @f.close
      rescue IOError => e
        PEROBS.log.fatal "Cannot close stack file #{@file_name}: #{e.message}"
      end
    end
Close the stack file. This method must be called before the program is
 terminated to avoid data loss.