cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_CREATE_MISSING_DIRS and empty folders

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 19 Feb 2006 13:17:34 +0100 (CET)

On Sun, 19 Feb 2006, Silex wrote:

> Say I have a directory to upload using libcurl, say I'm uploading all the
> files and all works fine etc. I said to libcurl to create the missing dirs
> so I just have to loop on my files and it creates the directory tree
> accuratly on the other side except.... when one directory inside my tree is
> empty.

Right, you upload them all and it creates missing dirs.

> So, I thought I'd just loop on files and directories and go on, but then it
> created an a file instead of a folder, so I added a / at the end of the url
> and then it created a (nil) file inside the folder, then I added NOBODY and
> it worked.

Yes, but then you tried to upload a file to a URL without a file name part,
right? What did you expect to happen when you did that? (I'm not saying (nil)
is right, I just don't understand what you wanted it to do.)

> If I understand right, you say I'd create remote directories by setting
> CREATE_MISSING_DIRS but NOT setting the UPLOAD option ? (like a FTP LIST ?)

CREATE_MISSING_DIRS should work equally fine for both downloads and uploads. I
don't think your problem is related to the CREATE_MISSING_DIRS option at all.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-02-19