cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Does libcurl automatically create directories in FTP?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 10 Oct 2002 08:51:14 +0200 (MET DST)

On Wed, 9 Oct 2002, Guido Reina wrote:

> Imagine I want to upload the local file c:\file to ftp://<ip>/1/2/3/, does
> libcurl create the directories /1/2/3/ if they don't exist? or do I have to
> do something like this:
>
> headerlist = curl_slist_append(headerlist, "1");
> headerlist = curl_slist_append(headerlist, "2");
> headerlist = curl_slist_append(headerlist, "3");
> headerlist = curl_slist_append(headerlist, "RNFR /1/2/3/file");

Eh, "1" or "2" etc are no known or understood FTP commands. They'll fail.

The actual command to create subdirectories over FTP is "MKD". So you can
probably use a command chain similar to:

 headerlist = curl_slist_append(headerlist, "MKD 1");
 headerlist = curl_slist_append(headerlist, "MKD 1/2");
 headerlist = curl_slist_append(headerlist, "MKD 1/2/3");

... and then upload a file to the 1/2/3 directory.

-- 
 Daniel Stenberg -- curl related mails on curl related mailing lists please
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-10-10