anchor.diff:  
   %% @doc Make a private copy of a torrent file.
   %% @end
  --spec copy(Torrentfile::string()) -> ok.
  -copy(Torrentfile) when is_list(Torrentfile) ->
  -    File = filename:basename(Torrentfile),
  -    Dotdir = gproc:get_env(l, etorrent, dotdir),
  -    Dest = filename:join([Dotdir, File]),
  +-spec copy_file(Torrentfile::string()) -> ok.
  +copy_file(Torrentfile) when is_list(Torrentfile) ->
  +    Dest = copy_path(Torrentfile),
       case file:copy(Torrentfile, Dest) of
           {ok, _} -> ok;
           {error, _}=Error -> Error
       end.
  +
  +-spec copy_path(Torrentfile::string()) -> Copyfile::string().
  +copy_path(Torrentfile) ->
  +    File = filename:basename(Torrentfile),
  +    Dotdir = gproc:get_env(l, etorrent, dotdir),
  +    filename:join([Dotdir, File]).
  +
  +%% @doc Get the path of the info file for a torrent.
  +%% @end
  +-spec info_path(Torrentfile::string()) -> Infofile::string().
  +info_path(Torrentfile) when is_list(Torrentfile) ->
  +    copy_path(Torrentfile) ++ ".info".
  +
  +%% @doc Get the info hash of a torrent file.
  +%% @end
  +-spec info_hash(Torrentfile::string()) -> binary().
  +info_hash(Torrentfile) ->
  +    {ok, Torrent} = etorrent_bcoding:parse_file(Torrentfile),
  +    etorrent_metainfo:get_infohash(Torrent).
   
   %% @private Check if a file path exists.
   -spec exists(Path::string()) -> boolean().
  
positive.code:             {setup,local,
                  fun() -> ?MODULE:make() end,
                  fun(_) -> ok end, [
                  ?_test(test_copy_torrent())
              ]}
          ]}
      ]}.
  
negative.code:     ?assert(?MODULE:exists(gproc:get_env(l, etorrent, dotdir))).
  
  test_copy_torrent() ->
      ok = ?MODULE:copy_file(testpath()),
      ?assertEqual({ok, [testfile()]}, ?MODULE:torrents()).
  
  test_info_filename() ->
      ok = ?MODULE:copy_file(testpath()),
      ?assertEqual({ok, [testfile()]}, ?MODULE:torrents()).
  
  test_info_hash() ->
      ?assertEqual(testhash(), ?MODULE:info_hash(testpath())).
  
  -endif.
  