anchor.diff:  	    ct:fail("Unexpected error for ~p: ~p",[Path,Error])
       end.
   
  -%%-------------------------------------------------------------------------
  -progress_report_send() ->
  -    [{doc, "Test the option progress for ftp:send/[2,3]"}].
  -progress_report_send(Config) when is_list(Config) ->
  -    ReportPid = 
  -	spawn_link(?MODULE, progress_report_receiver_init, [self(), 1]),
  -    send(Config),
  -    receive
  -	{ReportPid, ok} ->
  -	    ok
  -    end.
  -%%-------------------------------------------------------------------------
  -progress_report_recv() ->
  -    [{doc, "Test the option progress for ftp:recv/[2,3]"}].
  -progress_report_recv(Config) when is_list(Config) ->
  -    ReportPid = 
  - 	spawn_link(?MODULE, progress_report_receiver_init, [self(), 3]),
  -    recv(Config),
  -    receive
  - 	{ReportPid, ok} ->
  - 	    ok
  -    end.
  -
  -%%-------------------------------------------------------------------------
  -
  -not_owner() ->
  -    [{doc, "Test what happens if a process that not owns the connection tries "
  -    "to use it"}].
  -not_owner(Config) when is_list(Config) ->
  -    Pid = proplists:get_value(ftp, Config),
  -
  -    Parent = self(),
  -    OtherPid = spawn_link(
  -		 fun() ->
  -			 {error, not_connection_owner} = ftp:pwd(Pid),
  -			 ftp:close(Pid),
  -			 Parent ! {self(), ok}
  -		 end),
  -    receive
  -	{OtherPid, ok} ->
  -	    {ok, _} = ftp:pwd(Pid)
  -    end.
  -
  -
  -%%-------------------------------------------------------------------------
  -
  -
  -unexpected_call()->
  -    [{doc, "Test that behaviour of the ftp process if the api is abused"}].
  -unexpected_call(Config) when is_list(Config) ->
  -    Flag =  process_flag(trap_exit, true),
  -    Pid = proplists:get_value(ftp, Config),
  -    
  -    %% Serious programming fault, connetion will be shut down 
  -    case (catch gen_server:call(Pid, {self(), foobar, 10}, infinity)) of
  -	{error, {connection_terminated, 'API_violation'}} ->
  -	    ok;
  -	Unexpected1 ->
  -	    exit({unexpected_result, Unexpected1})
  -    end,
  -    ct:sleep(500),
  -    undefined = process_info(Pid, status),
  -    process_flag(trap_exit, Flag).
  -%%-------------------------------------------------------------------------
  -
  -unexpected_cast()->
  -    [{doc, "Test that behaviour of the ftp process if the api is abused"}].
  -unexpected_cast(Config) when is_list(Config) ->
  -    Flag = process_flag(trap_exit, true),
  -    Pid = proplists:get_value(ftp, Config),
  -    %% Serious programming fault, connetion will be shut down 
  -    gen_server:cast(Pid, {self(), foobar, 10}),
  -    ct:sleep(500),
  -    undefined = process_info(Pid, status),
  -    process_flag(trap_exit, Flag).
  -%%-------------------------------------------------------------------------
  - 
  -unexpected_bang()->
  -    [{doc, "Test that connection ignores unexpected bang"}].
  -unexpected_bang(Config) when is_list(Config) ->
  -    Flag = process_flag(trap_exit, true),
  -    Pid = proplists:get_value(ftp, Config),
  -    %% Could be an innocent misstake the connection lives. 
  -    Pid ! foobar, 
  -    ct:sleep(500),
  -    {status, _} = process_info(Pid, status),
  -    process_flag(trap_exit, Flag).
  -    
  -%%-------------------------------------------------------------------------
  -
  -clean_shutdown() -> 
  -    [{doc, "Test that owning process that exits with reason "
  -     "'shutdown' does not cause an error message. OTP 6035"}].
  -
  -clean_shutdown(Config) ->
  -    PrivDir = proplists:get_value(priv_dir, Config),
  -    LogFile = filename:join([PrivDir,"ticket_6035.log"]),
  -    Host = proplists:get_value(ftpd_host,Config),
  -    try
  -	Pid  = spawn(?MODULE, open_wait_6035, [Host, self()]),
  -	    error_logger:logfile({open, LogFile}),
  -	    true = kill_ftp_proc_6035(Pid, LogFile),
  -	    error_logger:logfile(close)
  -    catch 
  -	throw:{error, not_found} ->
  -	    {skip, "No available FTP servers"}
  -    end.
  -
  -%%%----------------------------------------------------------------
  -%%% Error codes not tested elsewhere
  -
  -error_elogin(Config0) ->
  -    Dir = "test",
  -    OldFile = "old.txt",
  -    NewFile = "new.txt",
  -    SrcDir = "data",
  -    File = "file.txt",
  -    Config = set_state([reset,
  -			{mkdir,Dir},
  -			{mkfile,OldFile,<<"Contents..">>},
  -			{mkfile,[SrcDir,File],<<"Contents..">>}], Config0),
  -
  -    Pid = proplists:get_value(ftp, Config),
  -    ok = ftp:lcd(Pid, id2ftp(SrcDir,Config)),
  -    {error,elogin} = ftp:send(Pid, File),
  -    ok = ftp:lcd(Pid, id2ftp("",Config)),
  -    {error,elogin} = ftp:pwd(Pid),
  -    {error,elogin} = ftp:cd(Pid, id2ftp(Dir,Config)),
  -    {error,elogin} = ftp:rename(Pid, 
  -				id2ftp(OldFile,Config),
  -				id2ftp(NewFile,Config)),
  -    ok.
  -
  -error_ehost(Config) ->
  -    {error, ehost} = ftp:open("nohost.nodomain"),
  -    ok.
  -    
   %%--------------------------------------------------------------------
  -%% Internal functions
  -%%--------------------------------------------------------------------
  -
   find_executable(Config) ->
       FTPservers = case proplists:get_value(ftpservers,Config) of
   		     undefined -> ?default_ftp_servers;
  
positive.code: %% Common Test interface functions -----------------------------------
  %%--------------------------------------------------------------------
  suite() ->
      [{timetrap,{seconds,10}}].
  
  all() ->
      [
  
negative.code:     %% = ftp:quote(Pid, "list"), 
      ok.
  
  %%-------------------------------------------------------------------------
  progress_report_send() ->
      [{doc, "Test the option progress for ftp:send/[2,3]"}].
  progress_report_send(Config) when is_list(Config) ->
      ReportPid = 
  	spawn_link(?MODULE, progress_report_receiver_init, [self(), 1]),
      send(Config),
      receive
  	{ReportPid, ok} ->
  	    ok
      end.
  %%-------------------------------------------------------------------------
  progress_report_recv() ->
      [{doc, "Test the option progress for ftp:recv/[2,3]"}].
  progress_report_recv(Config) when is_list(Config) ->
      ReportPid = 
   	spawn_link(?MODULE, progress_report_receiver_init, [self(), 3]),
      recv(Config),
      receive
   	{ReportPid, ok} ->
   	    ok
      end.
  
  %%-------------------------------------------------------------------------
  
  not_owner() ->
      [{doc, "Test what happens if a process that not owns the connection tries "
      "to use it"}].
  not_owner(Config) when is_list(Config) ->
      Pid = proplists:get_value(ftp, Config),
  
      Parent = self(),
      OtherPid = spawn_link(
  		 fun() ->
  			 {error, not_connection_owner} = ftp:pwd(Pid),
  			 ftp:close(Pid),
  			 Parent ! {self(), ok}
  		 end),
      receive
  	{OtherPid, ok} ->
  	    {ok, _} = ftp:pwd(Pid)
      end.
  
  
  %%-------------------------------------------------------------------------
  
  
  unexpected_call()->
      [{doc, "Test that behaviour of the ftp process if the api is abused"}].
  unexpected_call(Config) when is_list(Config) ->
      Flag =  process_flag(trap_exit, true),
      Pid = proplists:get_value(ftp, Config),
      
      %% Serious programming fault, connetion will be shut down 
      case (catch gen_server:call(Pid, {self(), foobar, 10}, infinity)) of
  	{error, {connection_terminated, 'API_violation'}} ->
  	    ok;
  	Unexpected1 ->
  	    exit({unexpected_result, Unexpected1})
      end,
      ct:sleep(500),
      undefined = process_info(Pid, status),
      process_flag(trap_exit, Flag).
  %%-------------------------------------------------------------------------
  
  unexpected_cast()->
      [{doc, "Test that behaviour of the ftp process if the api is abused"}].
  unexpected_cast(Config) when is_list(Config) ->
      Flag = process_flag(trap_exit, true),
      Pid = proplists:get_value(ftp, Config),
      %% Serious programming fault, connetion will be shut down 
      gen_server:cast(Pid, {self(), foobar, 10}),
      ct:sleep(500),
      undefined = process_info(Pid, status),
      process_flag(trap_exit, Flag).
  %%-------------------------------------------------------------------------
   
  unexpected_bang()->
      [{doc, "Test that connection ignores unexpected bang"}].
  unexpected_bang(Config) when is_list(Config) ->
      Flag = process_flag(trap_exit, true),
      Pid = proplists:get_value(ftp, Config),
      %% Could be an innocent misstake the connection lives. 
      Pid ! foobar, 
      ct:sleep(500),
      {status, _} = process_info(Pid, status),
      process_flag(trap_exit, Flag).
      
  %%-------------------------------------------------------------------------
  
  clean_shutdown() -> 
      [{doc, "Test that owning process that exits with reason "
       "'shutdown' does not cause an error message. OTP 6035"}].
  
  clean_shutdown(Config) ->
      PrivDir = proplists:get_value(priv_dir, Config),
      LogFile = filename:join([PrivDir,"ticket_6035.log"]),
      Host = proplists:get_value(ftpd_host,Config),
      try
  	Pid  = spawn(?MODULE, open_wait_6035, [Host, self()]),
  	    error_logger:logfile({open, LogFile}),
  	    true = kill_ftp_proc_6035(Pid, LogFile),
  	    error_logger:logfile(close)
      catch 
  	throw:{error, not_found} ->
  	    {skip, "No available FTP servers"}
      end.
  
  %%%----------------------------------------------------------------
  %%% Error codes not tested elsewhere
  
  error_elogin(Config0) ->
      Dir = "test",
      OldFile = "old.txt",
      NewFile = "new.txt",
      SrcDir = "data",
      File = "file.txt",
      Config = set_state([reset,
  			{mkdir,Dir},
  			{mkfile,OldFile,<<"Contents..">>},
  			{mkfile,[SrcDir,File],<<"Contents..">>}], Config0),
  
      Pid = proplists:get_value(ftp, Config),
      ok = ftp:lcd(Pid, id2ftp(SrcDir,Config)),
      {error,elogin} = ftp:send(Pid, File),
      ok = ftp:lcd(Pid, id2ftp("",Config)),
      {error,elogin} = ftp:pwd(Pid),
      {error,elogin} = ftp:cd(Pid, id2ftp(Dir,Config)),
      {error,elogin} = ftp:rename(Pid, 
  				id2ftp(OldFile,Config),
  				id2ftp(NewFile,Config)),
      ok.
  
  error_ehost(Config) ->
      {error, ehost} = ftp:open("nohost.nodomain"),
      ok.
      
  %%--------------------------------------------------------------------
  %% Internal functions  -----------------------------------------------
  %%--------------------------------------------------------------------
  