anchor.diff:      NewState = State#state{handle=Handle},
       {noreply, NewState};
   
  -handle_cast(close, State) ->
  +handle_cast(close, State) when State#state.dir_monitor =/= none ->
       #state{
           torrent=Torrent,
           handle=Handle,
  
positive.code: 
  -record(state, {
      torrent :: torrent_id(),
      handle=closed :: 'closed' | file:io_device(),
      relpath :: file_path(),
      fullpath :: file_path(),
      dir_monitor :: reference()}).
  
  
  -spec start_link(torrent_id(), file_path(), file_path()) -> {'ok', pid()}.
  
negative.code:     NewState = #state{handle=closed},
      {noreply, NewState}.
  
  handle_info({'DOWN', DirMon, _, _, _}, State)
  when DirMon == State#state.dir_monitor ->
      #state{
          torrent=Torrent,
          handle=Handle} = State,
      AwaitRef = erlang_io:await_new_directory(Torrent),
      case Handle of
          closed ->
              NewState = State#state{
                  dir_monitor=none,
                  await_ref=AwaitRef},
              {noreply, NewState};
          Handle ->
              ok = file:close(Handle),
              NewState = State#state{
                  handle=closed,
                  dir_monitor=none,
                  await_ref=AwaitRef},
              {noreply, NewState}
      end;
  
  handle_info({gproc, AwaitRef, registered, {_, DirPid, _}}, State)
  when AwaitRef == State#state.await_ref ->
      DirMon = erlang:monitor(process, DirPid),
      NewState = #state{
          dir_monitor=DirMon,
          await_ref=none},
      {noreply, NewState}.
  
  
  
  terminate(_, _) ->
      not_implemented.
  