anchor.diff:      end.
   
   handle_info({Port, {data, Data}}, State = #state{port=Port,
  -                                                 outfile=Out,
                                                    raw_log=Raw}) ->
       Decoded = data_util:decode(Data),
       io:format(Raw, "~p~n", [Decoded]),
  
positive.code: -export([handle_call/3, handle_cast/2]).
  -export([code_change/3]).
  
  -record(state, {port, err_log, raw_log, outfile}).
  
  start_link() ->
      gen_server:start_link(?MODULE, [], []).
  
negative.code:     {ok, Dir} = application:get_env(?MODULE, data_dir),
      {ok, Errlog} = file:open(Dir ++ "/err.log", [write]),
      {ok, Log} = file:open(Dir ++ "/raw.txt", [append]),
      Port = open_port({spawn_executable, Executable}, [{packet, 2}]),
      case erlang:port_info(Port) of
          undefined -> {stop, can_not_open_port};
          _ ->
              State = #state{port = Port,
                             err_log = Errlog,
                             raw_log = Log},
              {ok, State}
      end.
  
  