cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Set CURLOPT_FTP_FILEMETHOD to CURLFTPMETHOD_NOCWD does not work when changing dir

From: Nuno Esculcas <nuno.esculcas_at_gmail.com>
Date: Tue, 22 Nov 2011 14:28:53 +0000

Thanks for the reply, and i have a question about your answer, how do i
stop reusing some ftp connections and others not, because i use the same
instance of the libcurl to access several ftp server's but only one or two
do this, the others i want to take advantage of the re-use.

Thanks

On Mon, Nov 21, 2011 at 2:52 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 18 Nov 2011, Nuno Esculcas wrote:
>
> I'm having a little problem here accessing a ftp that does not allow me
>> to access the root directory.
>>
>
> That seems like a server with a weird setup to me. It is hard to work with
> such a beast.
>
>
> For this i use the CURLFTPMETHOD_NOCWD option in order to avoid commands
>> like this CWD "/", or CURLFTPMETHOD_SINGLECWD in order to access directly
>> to the ftp path.
>>
>
> That works for when libcurl is to change or not change directory to where
> it is about to operate. But when a connection is re-used, libcurl will go
> back to the original path first before trying the new path and in your case
> the original path is "/"...
>
> You can work around your stupid server by simply making sure you don't
> re-use the connection for subsequent requests as then libcurl won't try to
> issue "CWD /".
>
> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-- 
Nuno Esculcas

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-22