cURL / Mailing Lists / curl-library / Single Mail


Re: Trouble getting a directory listing before uploading a file

From: James Housley <>
Date: Mon, 30 May 2005 19:00:14 -0400

Daniel Stenberg wrote:
> 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?

Only messy because the server MOTD will show up three times.

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

Are you saying I could get what I want with multi-? Or is that just
multiple easy- and not get me more.

> 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.

Okay, I will look into how to do the listings and such.


/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------     The Power to Serve
VEGETARIAN: Old Indian word for "Bad Hunter".

Received on 2005-05-31