anchor.diff:      MiniMib = snmp_mini_mib:create(Mibs),
       Write = fun(X) -> 
   		    case format_msg(X, MiniMib, Start, Stop) of
  -			{ok, S} ->
  -			    io:format("~s", [S]);
  -			_ ->
  -			    ok
  +			{Tag, S} when (Tag =:= ok) orelse (Tag =:= error) ->
  +			    io:format("~s", [S]),
  +                            Tag;
  +			X ->
  +			    X
   		    end
   	    end,
  -    (catch loop(disk_log:chunk(Log, start), Log, Write)),
  +    Res = (catch loop(Log, Write)),
       snmp_mini_mib:delete(MiniMib),
  -    ok.
  -
  -
  -loop(eof, _Log, _Write) ->
  +    Res.
  +
  +
  +loop(Log, Write) ->
  +    loop(disk_log:chunk(Log, start), Log, Write, 0, 0).
  +
  +loop(eof, _Log, _Write, _NumOK, 0 = _NumERR) ->
       ok;
  -loop({error, _} = Error, _Log, _Write) ->
  +loop(eof, _Log, _Write, NumOK, NumERR) ->
  +    {ok, {NumOK, NumERR}};
  +loop({error, _} = Error, _Log, _Write, _NumOK, _NumERR) ->
       Error;
  -loop({Cont, Terms}, Log, Write) ->
  -    case (catch lists:foreach(Write, Terms)) of
  -	{'EXIT', Reason} ->
  -	    {error, Reason};
  -	_ ->
  -	    loop(disk_log:chunk(Log, Cont), Log, Write)
  +loop({Cont, Terms}, Log, Write, NumOK, NumERR) ->
  +    try loop_terms(Terms, Write) of
  +        {ok, {AddedOK, AddedERR}} ->
  +            loop(disk_log:chunk(Log, Cont), Log, Write,
  +                 NumOK+AddedOK, NumERR+AddedERR)
  +    catch
  +        T:E ->
  +            {error, {T, E}}
       end;
  -loop({Cont, Terms, BadBytes}, Log, Write) ->
  +loop({Cont, Terms, BadBytes}, Log, Write, NumOK, NumERR) ->
       error_logger:error_msg("Skipping ~w bytes while converting ~p~n~n", 
   			   [BadBytes, Log]),
  -    case (catch lists:foreach(Write, Terms)) of
  -	{'EXIT', Reason} ->
  -	    {error, Reason};
  -	_ ->
  -	    loop(disk_log:chunk(Log, Cont), Log, Write)
  -    end;
  -loop(Error, _Log, _Write) ->
  -    Error.
  +    try loop_terms(Terms, Write) of
  +        {ok, {AddedOK, AddedERR}} ->
  +            loop(disk_log:chunk(Log, Cont), Log, Write,
  +                 NumOK+AddedOK, NumERR+AddedERR)
  +    catch
  +        T:E ->
  +            {error, {T, E}}
  +    end.
  +
  +
  +loop_terms(Terms, Write) ->
  +    loop_terms(Terms, Write, 0, 0).
  +
  +loop_terms([], _Write, NumOK, NumERR) ->
  +    {ok, {NumOK, NumERR}};
  +loop_terms([Term|Terms], Write, NumOK, NumERR) ->
  +    try Write(Term) of
  +        ok ->
  +            loop_terms(Terms, Write, NumOK+1, NumERR);
  +        error ->
  +            loop_terms(Terms, Write, NumOK,   NumERR+1);
  +        _ ->
  +            loop_terms(Terms, Write, NumOK,   NumERR)
  +    catch
  +        T:E:S ->
  +            {error, {T, E, S}}
  +    end.
   
   
   format_msg(Entry, Mib, Start, Stop) ->
  
positive.code: 	end,
      format_tab(
        "~w ~s - ~s [~s]~s ~w\n~s",
        [Class, AddrStr, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
  
  %% f(TimeStamp, SeqNo,
  %%   #message{version = Vsn, vsn_hdr = VsnHdr, data = Data},
  %%   Addr, Port, Mib) ->
  %%     Str    = format_pdu(Data, Mib),
  %%     HdrStr = format_header(Vsn, VsnHdr),
  %%     case get_type(Data) of
  %%         trappdu ->
  %%             f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
  %%         'snmpv2-trap' ->
  %%             f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
  %%         'inform-request' ->
  %%             f_inform(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
  %%         'get-response' ->
  %%             f_response(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
  %%         report ->
  %%             f_report(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port);
  %%         _ ->
  %%             f_request(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port)
  %%     end.
  
  %% f_request(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
  %%     format_tab("request ~s:~w - ~s [~s]~s ~w\n~s",
  %% 	       [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
  
  %% f_response(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
  %%     format_tab("response ~s:~w - ~s [~s]~s ~w\n~s",
  %% 	       [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
  
  %% f_report(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
  %%     format_tab("report ~s:~w - ~s [~s]~s ~w\n~s",
  %% 	       [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
  
  %% f_trap(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
  %%     format_tab("trap ~s:~w - ~s [~s]~s ~w\n~s",
  %% 	       [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
  
  %% f_inform(TimeStamp, SeqNo, Vsn, HdrStr, Str, Addr, Port) ->
  %%     format_tab("inform ~s:~w - ~s [~s]~s ~w\n~s",
  %% 	       [ip(Addr), Port, HdrStr, TimeStamp, SeqNo, Vsn, Str]).
  
  ipPort2Str(Ip, Port) ->
      snmp_conf:mk_addr_string({Ip, Port}).
      %% io_lib:format("~s:~w", [ip(Ip), Port]).
  
  %% Convert a timestamp 2-tupple to a printable string
  %%
  
negative.code:             MiniMib = snmp_mini_mib:create(Mibs),
  	    Write = fun(X) -> 
  			    case format_msg(X, MiniMib, Start, Stop) of
                                  {Tag, S} when (Tag =:= ok) orelse (Tag =:= error) ->
  				    io:format(Fd, "~s", [S]),
                                      Tag;
  				X ->
  				    X
  			    end
  		    end,
              Res = (catch loop(Log, Write)),
  	    snmp_mini_mib:delete(MiniMib), 
              file:close(Fd),
              Res;
  