anchor.diff:  -export([main/1]).
   -import(string, [to_integer/1, substr/2, substr/3]).
   
  -io_write(Data) ->
  +io_write(Data) when is_list(Data) ->
  +  io_write(list_to_binary(Data));
  +io_write(Data) when is_binary(Data) ->
     case file:write(group_leader(), Data) of
       ok              -> ok;
       {error, Reason} -> exit(file:format_error(Reason))
  
positive.code:   Sender = fun(Data) -> gen_tcp:send(Socket, Data) end,
  
    case read_prefix() of
      {"DIST", V, S} when V =:= 1; V =:= 2; V =:= 3 ->
        ok = Sender(list_to_binary(S)),
        format_log("distcc protocol version: ~w", [V])
    end,
  
negative.code: 
  transfar_request(1, Sender, {Req, Len, Orig}) ->
    Data = if
      Req =:= <<"ARGC">> -> <<>>;
      Req =:= <<"ARGV">>;
      Req =:= <<"DOTI">> -> io_read(Len)
    end,
    ok = Sender(list_to_binary([Orig, Data])),
    format_log("done").
  