anchor.diff:  
   -vsn("1").
   %% API
  --export([start_link/0, watch_dirs/0, dir_watched/0]).
  +-export([start_link/0, dir_watched/0]).
   
   %% gen_server callbacks
   -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
  
positive.code: %% gen_server callbacks
  %%====================================================================
  init([]) ->
      timer:apply_interval(?WATCH_WAIT_TIME, ?MODULE, watch_dirs, []),
      {ok, Dir} = application:get_env(etorrent, dir),
      {ok, #state{dir = Dir, fileset = empty_state()}}.
  
  handle_call(report_on_files, _Who, S) ->
      {reply, sets:to_list(S#state.fileset), S};
  handle_call(dir_watched, _Who, S) ->
      {reply, S#state.dir, S};
  handle_call(_Request, _From, State) ->
      Reply = ok,
      {reply, Reply, State}.
  
  handle_cast(watch_directories, S) ->
      {A, R, N} = scan_files_in_dir(S),
      lists:foreach(fun(F) ->
  			  torrent_manager:start_torrent(F)
  		  end,
  		  sets:to_list(A)),
      lists:foreach(fun(F) -> torrent_manager:stop_torrent(F) end,
  		  sets:to_list(R)),
      {noreply, N}.
  
  handle_info(_Info, State) ->
      {noreply, State}.
  
  terminate(_Reason, _State) ->
      ok.
  
negative.code: %%--------------------------------------------------------------------
  
  %% Operations
  watch_directories(S) ->
      {ok, A, R, N} = scan_files_in_dir(S),
      lists:foreach(fun(F) ->
  			  torrent_manager:start_torrent(F)
  		  end,
  		  sets:to_list(A)),
      lists:foreach(fun(F) -> torrent_manager:stop_torrent(F) end,
  		  sets:to_list(R)),
      N.
  
  empty_state() -> sets:new().
  
  