anchor.diff:      {ok, FileInfo} = file:read_file_info(TestFile),
       ok = file:write_file_info(TestFile,
   			      FileInfo#file_info{mode = Mode}).
  +
  +prepare(Config0) ->
  +    PrivDir = proplists:get_value(priv_dir, Config0),
  +    Dir = filename:join(PrivDir, random_chars(10)),
  +    file:make_dir(Dir),
  +    Keys = [filename,
  +	    testfile,
  +	    linktest,
  +	    tar_filename],
  +    Config1 = foldl_keydelete(Keys, Config0),
  +    Config2 = lists:foldl(fun({Key,Name}, ConfAcc) ->
  +				  [{Key, filename:join(Dir,Name)} | ConfAcc]
  +			  end,
  +			  Config1,
  +			  lists:zip(Keys, [proplists:get_value(K,Config0) || K<-Keys])),
  +
  +    DataDir =  proplists:get_value(data_dir, Config2),
  +    FilenameSrc = filename:join(DataDir, "sftp.txt"),
  +    FilenameDst = proplists:get_value(filename, Config2),
  +    {ok,_} = file:copy(FilenameSrc, FilenameDst),
  +    [{sftp_priv_dir,Dir} | Config2].
  +
  +
  +random_chars(N) -> [crypto:rand_uniform($a,$z) || _<-lists:duplicate(N,x)].
  +
  +foldl_keydelete(Keys, L) ->
  +    lists:foldl(fun(K,E) -> lists:keydelete(K,1,E) end, 
  +		L,
  +		Keys).
  +
   
   chk_tar(Items, Config) ->
       chk_tar(Items, Config, []).
  
positive.code: 		[{sftp, Sftp}, {watchdog, Dog} | Config2]
  	end,
  
      case catch ?config(remote_tar,Config) of
  	%% The 'catch' is for the case of Config={skip,...}
  	true ->
  	    %% Provide a ChannelPid independent of the sftp-channel already opened.
  
negative.code: open_close_dir() ->
      [{doc, "Test API functions opendir/2 and close/2"}].
  open_close_dir(Config) when is_list(Config) ->
      PrivDir = ?config(sftp_priv_dir, Config),
      {Sftp, _} = ?config(sftp, Config),
      FileName = ?config(filename, Config),
  
  