[Gambas-user] Problems working with FTPClient

Benoît Minisini gambas at ...1...
Sun Feb 17 01:50:09 CET 2013


Le 16/02/2013 21:47, Tobias Boege a écrit :
> On Sat, 16 Feb 2013, Tobias Boege wrote:
>> On Sat, 16 Feb 2013, Beno?t Minisini wrote:
>>> Le 16/02/2013 20:33, Tobias Boege a ?crit :
>>>>> 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
>>>>
>>>
>>> Do you use FtpClient in synchronous or asynchronous mode?
>>>
>>
>> It doesn't work with either mode.
>>
>>> Don't FtpClient raise its Read event when running the command?
>>
>> True. AFAICS, it is only raised when Get() is executed without an argument
>> and operates asynchronously?
>>
>> I attached a sample project showing the PWD and LIST commands. The former
>> doesn't need passive mode, the latter does. However, I couldn't get either
>> one to do any output.
>>
>> Additionally, FtpClient.Get() can be executed without argument and
>> asynchronously - nothing happens here. The application seems to hang.
>>
>> Regards,
>> Tobi
>
> Ahh! I must not use "Line Input #Last, sLine" but
> "Read #Last, sFile, Lof(Last)" to make the Read event trigger for
> FtpClient.Get(). I hope you can tell me why.
>
> The problem persists, however, with the calls to Exec(). There's no way to
> read their data.
>
> Regards,
> Tobi
>

I have fix some problems in the Read event handler of curl objects in 
revision #5553.

But indeed, commands sent with the Exec() methods cannot read or write 
any data.

To get the equivalent of the "LIST" command, issue a Get() on a FTP 
directory.

Regards,

-- 
Benoît Minisini




More information about the User mailing list