cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: DELELE occurence error later

From: M. Shinkaze <shinkaze75_at_gmail.com>
Date: Tue, 5 Jun 2012 00:18:43 +0200

2012/6/2 Dan Fandrich <dan_at_coneharvesters.com>

> On Fri, Jun 01, 2012 at 04:02:09PM +0200, M. Shinkaze wrote:
> > Sorry for the late reply, I change the way to proceed but got an error
> > "CURLE_QUOTE_ERROR" on the file "FILE.txt" to delete in the directory
> "dir" :
> >
> > firstly, I connect directly the the directory which contains the file to
> > suppress :
> > CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_URL, "ftp://server/dir
> ");
>
> This URL specifies a *file* named dir, not a directory. You need a
> trailing slash to specify a directory.
>
> > CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_CONNECT_ONLY, 1L);
>
> Why set this? It's not only documented to be useful for HTTP only, but
> even if it were usable for FTP, it would prevent anything from
> being sent.
>
> > CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_USERNAME, user);
> > CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_PASSWORD, passwd);
> > CurlErrorCode = curl_easy_setopt(m_esayH, CURLOPT_CONNECT_ONLY, 1L); ->
> here
>
> You don't say what m_esayH is, but it doesn't seem relevant when calling
> curl_easy_perform(pCurl);
>
> > without this option I got an error CURLE_REMOTE_FILE_NOT_FOUND
> > CurlErrorCode = curl_easy_perform(pCurl);
> >
> > then on another function I am trying to delete the file :
> >
> > CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_POSTQUOTE, "DELE
> File.txt");
> > CurlErrorCode = curl_easy_perform(pCurl);
> >
> > this last perform return "CURLE_QUOTE_ERROR"
>
> If you enable debugging, you'll likely notice that libcurl never enters
> the directory "dir", because "dir" is specified in the URL to be a file.
>
> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

right it's a mistake of mine it's not m_esayH but trully pCurl which is
used but as you said not used for FTP transfert
//CurlErrorCode = curl_easy_setopt(pCurl , CURLOPT_CONNECT_ONLY, 1L);

I have corrected the missing trailing slash and it works, thanks you!
but if the file does not exists I got a curl error number 21 (QUOT string
not accepted: DELE File.txt)

then on my code, I reset the pCurl :

curl_easy_reset(pCurl);

and re-use the pCurl :

CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_ERRORBUFFER, CurlErrorBuff);

CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_URL, "ftp://server/dir");

CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_USERNAME, user);

CurlErrorCode = curl_easy_setopt(pCurl, CURLOPT_PASSWORD, passwd);

CurlErrorCode = curl_easy_perform(pCurl);

in the perform, I got a curl error: 23 (Failed writing body (25 != 456))
Really can't figure out the problem... it supposes to be simple here.
it's like a kind of the easy handle esi destabilize by the previous QUOT
string error of DELETE ?
any idea ?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-06-05