[Gambas-user] Problems working with FTPClient

Tobias Boege taboege at ...626...
Sat Feb 16 20:33:13 CET 2013


On Sat, 16 Feb 2013, Beno?t Minisini wrote:
> Le 16/02/2013 20:00, Beno?t Minisini a ?crit :
> > Le 16/02/2013 19:16, Tobias Boege a ?crit :
> >> Hi,
> >>
> >> I have huge trouble working with the FTPClient.Exec() method (sanely)
> >> when
> >> it comes to data transfer.
> >>
> >> My goal is to get the directory contents of the root directory, for
> >> example.
> >> This is accomplished using the LIST command which is not implemented in
> >> FTPClient, so one must use Exec(). The problem is that this command
> >> needs a
> >> passive mode data channel...
> >>
> >> AFAICS, this _cannot_ be done with FTPClient alone as there is no way to
> >> tell it to open up a new socket to read from the server's passive
> >> socket and
> >> raise the Read event (or a PassiveRead event to keep the point of the
> >> passive connection).
> >>
> >> There should, IMHO, at least be something like a bPassive argument to
> >> FTPClient.Exec() or so to make the FTPClient aware of the fact that we
> >> want
> >> to get data in passive mode. I don't know how hard this could be with
> >> curl
> >> but there must be something like that already in the Get() method...
> >>
> >> I experimented a good hour with two plain sockets but didn't come to a
> >> satisfying result. Or am I totally blind and don't see the right way? Has
> >> anyone had experience with something like that already?
> >>
> >> Of course, there is still the "ftp" program which I'm going to use now. I
> >> just wanted to point this issue out.
> >>
> >> Regards,
> >> Tobi
> >>
> >
> > FtpCLient is based on libcurl. So if libcurl allows passive mode, it
> > should be easy to add it...
> >
> 
> libcurl uses passive mode by default apparently.
> 
> And you must not use sockets to deal with FtpClient. FtpClient is the 
> object you have to read in asynchronous mode.

OK. I see the transfer delay in my application when using Exec(["LIST"]).
The data seems to get to through to curl. But as a matter of fact, there is
no way to access this data using FtpClient.

It seems to be pretty straightforward to add my bPassive argument. Shall I
try?

Regards,
Tobi




More information about the User mailing list