cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl and deleting files from ftp server

From: lostsandman <lostsandman_at_gmail.com>
Date: Mon, 16 May 2005 12:58:45 +0100

sorry that may be a bad exmaple fo the logs. i will try to post a different one.

> Besides, your session makes a whole lot of unncessary "CWD /" that your app
> seems to force libcurl to do. I'd consider removing those if I were you.
>

you see this is what i was really try to get at. I am not sure why
this is taking place. here is the bit of code i am using yo get a file

curl_easy_reset(m_curl);

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl, CURLOPT_URL,
requestUrl.c_str()));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl,
CURLOPT_USERPWD, m_usernamePassword.c_str()));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl,
CURLOPT_NOPROGRESS, 1));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl,
CURLOPT_WRITEFUNCTION, GetFileCallbackFunction));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl,
CURLOPT_WRITEDATA, &getFileCallbackStruct));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_perform(m_curl));

                statusCode = STATUS_CODE_SUCCESS;

This is what i do for delete a file

ftpCommand = "DELE " + filename;
list = curl_slist_append(list, ftpCommand.c_str());

        
                curl_easy_reset(m_curl);

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl, CURLOPT_URL,
m_url.c_str()));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl,
CURLOPT_USERPWD, m_usernamePassword.c_str()));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl,
CURLOPT_NOPROGRESS, 1));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl, CURLOPT_QUOTE, list));

                ACTIV_THROW_RESULT_IF(CURLE_OK, !=, curl_easy_setopt(m_curl,
CURLOPT_WRITEFUNCTION, DummyCallbackFunction));

                THROW_RESULT_IF(CURLE_OK, !=, curl_easy_perform(m_curl));

                statusCode = STATUS_CODE_SUCCESS;

i can't seem to find what i am doing wrong here.....

thanks

On 5/16/05, Daniel Stenberg <daniel-curl_at_haxx.se> wrote:
> On Mon, 16 May 2005, lostsandman wrote:
>
> > For some reason its taking lots of time to a delete a file compared to
> > downloading it!
>
> If so, then I don't understand your logs:
>
> > (000007) 16/05/2005 10:48:00 - test (172.16.13.171)> LIST
>
> The first thing you showed us in the log...
>
> > (000007) 16/05/2005 10:48:00 - test (172.16.13.171)> 226 Transfer OK
>
> ... and this was the last line.
>
> They're logged the _same_ second. How slow is that?
>
> Besides, your session makes a whole lot of unncessary "CWD /" that your app
> seems to force libcurl to do. I'd consider removing those if I were you.
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2005-05-16