cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: DELELE occurence error later

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 2 Jun 2012 00:32:51 +0200

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
Received on 2012-06-02