Call cwd or cwdasync to select the directory you want.

I see in your code sample that you use "synchronous" (blocking) methods. 
This makes programming easier, for simple things, but on the long term, for 
more complex tasks, it is better to use asynchronous operation. In that 
programming model, you call a method (for example GetAsync) and then you 
exit your procedure (which is for example a buttonclick event). When the 
operation is done in the background, the component triggers an OnRequestDone 
event for which you shall write an handler and call the next method you have 
to call. If you like theory, you'll write a "finite state machine" to 
implement your application. See 
http://en.wikipedia.org/wiki/Finite_state_machine for some reference.


--
[EMAIL PROTECTED]
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

----- Original Message ----- 
From: "Darren Doggett" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Sunday, May 04, 2008 2:16 PM
Subject: [twsocket] how to get FTPClient to start here /Data/


Hi All,

I’m new to this so please forgive me! I’m trying to write a small ftp 
program to download TXT files from tgftp.nws.noaa.gov. I know the files are 
located here
/data/observations/metar/stations/ how do I get the FTPClient to start in 
this directory?

Here is what I Have

procedure TForm1.Button1Click(Sender: TObject);
begin
if ftp1.Connected then
ftp1.Quit;
with ftp1 do
begin
 binary := True;
 HostDirName := /data/observations/metar/stations/
 Hostname:= tgftp.nws.noaa.gov;
 UserName:=usernameString;
 Password:=PasswordString;
 Connect
end;
end;

when I send ‘pwd’ I always get “/”

here is the output

< 220 Authorized users only. All activity may be monitored and reported.
> USER anonymous
< 331 Please specify the password.
> PASS
< 230 Login successful.
> PWD
< 257 "/"

Thanks for any advise

Regards

Darren
_________________________________________________________________
Win Indiana Jones prizes with Live Search
http://clk.atdmt.com/UKM/go/msnnkmgl0010000002ukm/direct/01/
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to