anchor.diff:  
   
   
  +
  
positive.code:   gen_server:cast(whereis(?MODULE),close).
  
  %%%===================================================================
  %%% gen_server callbacks
  %%%===================================================================
  
  init([Model,Path]) ->
    Dict = case Model of
  
negative.code:   logList(Stat,Index+1,T,Dict).
  
  -spec logLocal(dict(),term(),atom(),term()) -> ok.
  %% @doc Dokonuje buforowanego zapisu do pliku lokalnej statystyki. W argumencie podany glowny slownik, klucz, nazwa statystyki i wartosc do wpisania.
  logLocal(Dictionary,Key,Statistic,Value) ->
    FDs = dict:fetch(Key,Dictionary),
    FD = dict:fetch(Statistic,FDs),
    file:write(FD,io_lib:fwrite("~p\n",[Value])).
  
  -spec logGlobal(dict(),atom(),term()) -> ok.
  %% @doc Dokonuje buforowanego zapisu do pliku globalnej statystyki. W argumencie podany glowny slownik, nazwa statystyki i wartosc do wpisania.
  logGlobal(Dictionary,Stat,Value) ->
    FD = dict:fetch(Stat,Dictionary),
    file:write(FD,io_lib:fwrite("~p\n",[Value])).
  
  -spec closeFiles(dict()) -> any().
  %% @doc Zamyka pliki podane w argumencie
  closeFiles(Dict) ->
    [case X of
       {Id,FD} when is_atom(Id) -> file:close(FD);
       {_Id,D} -> [file:close(FD) || {_Stat,FD} <- dict:to_list(D)]
     end || X <- dict:to_list(Dict)].
  
  -spec addCounters(tuple(),tuple()) -> tuple().
  addCounters({D1,F1,R1,M1},{D2,F2,R2,M2}) ->
    {D1+D2,F1+F2,R1+R2,M1+M2}.
  
  
  
  