cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Trouble getting a directory listing before uploading a file

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 30 May 2005 23:13:18 +0200 (CEST)

On Mon, 30 May 2005, James Housley wrote:

> What I need to do is after login to send NLST to get the directory listing
> of the current directory. Then get another directory listing after the
> final CWD before the STOR is sent to upload the file. I am using
> "libcurl/7.11.1 OpenSSL/0.9.6i ipv6 zlib/1.1.3" via CURHandle.Framework.
>
> I have set CURLOPT_FTPLISTONLY, and played around with CURLOPT_QUOTE,
> CURLOPT_PREQUOTE and CURLOPT_POSTQUOTE and decided they aren't right. I see
> the CURLOPT_CUSTOMREQUEST can send a custom command fom LIST/NLST, but I
> haven't gotten that working either.
>
> It appears that I could fake it with CURLOPT_NOBODY and do 3 connections,
> one to just connect and get a directory listing. The second to get the
> listing in the final CWD, and the third to STOR the file. But that is
> really messy.

Why is that messy?

With libcurl, the whole API is designed to do one transfer for each call to
curl_easy_perform(). Each dir listing means a transfer.

You cannot make data transfers with the *QUOTE options, as that would require
that they could parse the responses and start data connections and transfers
and more.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-05-30