cURL / Mailing Lists / curl-library / Single Mail


Re: Making a directory

From: Daniel Stenberg <>
Date: Mon, 17 Dec 2001 12:06:57 +0100 (MET)

On Mon, 17 Dec 2001, Guido Neitzer wrote:

> What is the correct way to only create a directory on an ftp-server with
> libcurl?
> Currently I do the following:
> [...]
> // setting the login:
> curl_easy_setopt (curl, CURLOPT_USERPWD, [login cString]);
> // setting the host and the url to work on:
> curl_easy_setopt (curl, CURLOPT_URL, [host cString]);
> // set the list of commands:
> curl_easy_setopt (curl, CURLOPT_POSTQUOTE, headerlist);
> res = curl_easy_perform (curl);
> [...]
> With that libcurl downloads the directory listing of the given url
> "host". The commands in the the [] brackets returns a char *
> The directory is created, but how can I avoid downloading a filelist?

You can't. libcurl was written to deal with file transfers, first and mainly.
We have no current way of saying "skip the transfer".

I'm not saying we can't add such an option or something. I'm open for
suggestions on how such a one would look/work/be used.

You can work around this by using the pre-quote option instead, and do your
actions before curl tries to download anything and then you can download a
non-existing file or you can have the last quote command be an error that
will cause curl to return failure.

    Daniel Stenberg -- curl groks URLs --
Received on 2001-12-17