curl-library
Re: How to consistently CWD to HOME directory before using MKD command
Date: Thu, 20 Sep 2012 23:19:51 +0200 (CEST)
On Thu, 20 Sep 2012, Bill Middlecamp wrote:
> 1) The "foo/bar" portion of the path may or may not exist, so I use MULTICWD
> together with the upload of a temporary file to get libcurl to create those
> directories if needed. Then I DELE the temporary file with a POSTQUOTE
> command.
>
> 2) Next, I change to NOCWD, and expect that this will produce a CWD to the
> HOME directory.
Oh. I can see how this messes up things. "NOCWD" kind of implies that you
don't want to do CWD commands, but since you re-use a connection that already
did libcurl will not act the way you'd like it to...
Can I ask what the point is to alter the CURLOPT_FTP_FILEMETHOD method like
that between requests?
Anyway, I think we need to handle this somehow. I just can't think of the best
possible fix right now. I think a good first step would be to write up a test
case for the curl test suite that repeats the above scenario so that we have
something to work with.
> How can I code this to work for all FTP servers?
This problem isn't happening because of the FTP server, it does so because you
tell it to NOCWD after libcurl has changed directory in a previous request.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2012-09-20