anchor.diff:  %%====================================================================
   init([]) ->
       {ok, Dir} = application:get_env(etorrent, dir),
  -    % Provide a timeout in 100 ms to get up fast
  -    {ok, #state{dir = Dir, fileset = sets:new()}, 100}.
  +    _Tid = ets:new(etorrent_dirwatcher, [named_table, protected]),
  +    {ok, #state{dir = Dir}, 0}.
   
  -handle_call(report_on_files, _Who, S) ->
  -    {reply, sets:to_list(S#state.fileset), S, ?WATCH_WAIT_TIME};
   handle_call(dir_watched, _Who, S) ->
       {reply, S#state.dir, S, ?WATCH_WAIT_TIME};
   handle_call(_Request, _From, State) ->
  
positive.code: 
  %% Operations
  watch_directories(S) ->
      {ok, A, R, N} = scan_files_in_dir(S),
      lists:foreach(fun(F) -> etorrent_mgr:start(F) end,
  		  sets:to_list(A)),
      lists:foreach(fun(F) -> etorrent_mgr:stop(F) end,
  		  sets:to_list(R)),
      N.
  
  scan_files_in_dir(S) ->
      Files = filelib:fold_files(S#state.dir, ".*\.torrent", false,
  			       fun(F, Accum) -> [F | Accum] end, []),
      FilesSet = sets:from_list(Files),
      Added = sets:subtract(FilesSet, S#state.fileset),
      Removed = sets:subtract(S#state.fileset, FilesSet),
      NewState = S#state{fileset = FilesSet},
      {ok, Added, Removed, NewState}.
  
negative.code:     {noreply, S, ?WATCH_WAIT_TIME}.
  
  handle_info(timeout, S) ->
      watch_directories(S),
      {noreply, S, ?WATCH_WAIT_TIME};
  handle_info(_Info, State) ->
      {noreply, State, ?WATCH_WAIT_TIME}.
  
  