cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_CREATE_MISSING_DIRS and empty folders

From: Silex <silex0r_at_gmail.com>
Date: Sun, 19 Feb 2006 13:04:01 +0100

Sorry I didn't mean to offend or to look confused.

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.

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.

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 ?)

Thank you
Philippe Vaucher

On 2/18/06, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Sat, 18 Feb 2006, Silex wrote:
>
> > I just wanted to signal that when you set CURLOPT_CREATE_MISSING_DIRS
> and
> > you transfer an empty folder ( with an url like ftp://server.com/path/),
>
> I don't get it. When do "you transfer an empty folder" ? You mean when you
> ask
> for a directory listing? Or are you uploading data?
>
> > it stores a file named (nil).
>
> It being libcurl I guess? You mean it creates a file named "(nil)" ? If
> so,
> since when does libcurl create local file for you? Or if you're uploading
> data, why are you uploding to a file without name?
>
> > To get rid of that you must set CURLOPT_NOBODY to 1.
>
> And what happens then?
>
> > I don't know if it's something intended
>
> Creating a file called "(nil)" is not intended nor documented. I guess FTP
> upload to a URL without file name should simply fail.
>
> I don't consider it a very serious error though. Should I?
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2006-02-19