anchor.diff:              Acc
       end,
       fold_disk_log(disk_log:chunk(DiskLog, Cont), Fun, Acc2, DiskLog).
  +
  +tmp_dir() ->
  +    PDD = app_helper:get_env(riak_core, platform_data_dir, "/tmp"),
  +    TmpDir = filename:join(PDD, ?MODULE),
  +    TmpCanary = filename:join(TmpDir, "canary"),
  +    ok = filelib:ensure_dir(TmpCanary),
  +    TmpDir.
  
positive.code:     lager:debug("Starting key exchange between ~p and ~p", [LocalVN, RemoteVN]),
      lager:debug("Exchanging hashes for preflist ~p", [IndexN]),
  
      TmpDir = app_helper:get_env(riak_core, platform_data_dir, "/tmp"),
      {NA, NB, NC} = Now = WriteLog = now(),
      LogFile1 = lists:flatten(io_lib:format("~s/~s/in.~p.~p.~p",
                                             [TmpDir, ?MODULE, NA, NB, NC])),
      ok = filelib:ensure_dir(LogFile1),
      LogFile2 = lists:flatten(io_lib:format("~s/~s/out.~p.~p.~p",
                                             [TmpDir, ?MODULE, NA, NB, NC])),
      ok = filelib:ensure_dir(LogFile2),
      Remote = fun(get_bucket, {L, B}) ->
                       exchange_bucket(RemoteTree, IndexN, L, B);
                  (key_hashes, Segment) ->
  
negative.code:     Input = sort_disk_log_input(ReadLog),
      Output = sort_disk_log_output(WriteLog),
      try
          file_sorter:sort(Input, Output, [{format, term}, {tmpdir, tmp_dir()}])
      after
          ok = disk_log:close(ReadLog),
          ok = disk_log:close(WriteLog)
  