> Hello all (I'm new to the list, and this is my first post).

Welcome !

>    ICSFTP.OpenAsync;
>    ICSFTP.GetAsync;

Warning: You can't put async methods on consecutive lines. They are 
asynchronous, that it they return almost immediately, long before their 
operation is done. When you call an async method, you _must_ use 
OnrequestDone event to "chain" your operations. The async method is more or 
less the last one in any procedure such as a ButtonClick event handler.

If you want to put all your instructions in a row (on consecutive lines), 
then use only sync methods (those with their name not ending with async). 
This will result in a simpler program at first glance but less efficient and 
with less control on error conditions.

To experience with the FTP component, just use FtpTst saple program 
delivered with ICS.
Basically, to use the FTP component, you do a sequence of commands just like 
you would do using Windows command line FTP utility. You also have "high 
level" methods in the component which combine several "low level" commands. 
See quick reference guide at the start of the FTP component source code.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be




----- Original Message ----- 
From: "Clay Shannon" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Tuesday, August 15, 2006 4:39 PM
Subject: [twsocket] How to download (ftp) an entire directory (best way)


> Hello all (I'm new to the list, and this is my first post).
>
>
>
> Is the following the way to download (via ftp) the contents of an entire
> directory? IOW, providing the HostDirName but no HostFileName?
>
>
>
> Or...?
>
>
>
> I'm also open to suggestion on better ways to do this, such as removing
> unnecessary code (probably either ConnectAsync or OpenAsync is redundant,
> the same with GetAsync and ReceiveAsync, as well as Quit and Free. Any
> suggestions on which calls to keep and which to get rid of?
>
>
>
> procedure GetFTPFiles;
>
> var
>
>  ICSFTP: TFTPClient;
>
> begin
>
>  ICSFTP := TFTPClient.Create(nil);
>
>  try
>
>    ICSFTP.UserName := 'BillyBob';
>
>    . . .
>
>    ICSFTP.HostDirName :=
> '/dasFesche/Umherstolzieren/desHahns/IstEin/BekannterAnblick';
>
>    //leave ICSFTP.HostFileName unspecified?
>
>    { probably only one of the following two methods is needed.? }
>
>    ICSFTP.ConnectAsync;
>
>    ICSFTP.OpenAsync;
>
>    { probably only one of the following two methods is needed.? }
>
>    ICSFTP.GetAsync;
>
>    ICSFTP.ReceiveAsync;
>
>  finally
>
>    { probably only one of the following two methods is needed.? }
>
>    ICSFTP.Quit;
>
>    ICSFTP.Free;
>
>  end;
>
> end;
>
>
>
> --
>
>


--------------------------------------------------------------------------------


> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material.  If the reader of this message is not the intended recipient,
> you are hereby notified that your access is unauthorized, and any review,
> dissemination, distribution or copying of this message including any
> attachments is strictly prohibited.   If you are not the intended
> recipient, please contact the sender and delete the material from any
> computer.
>


--------------------------------------------------------------------------------


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

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

Reply via email to