cURL / Mailing Lists / curl-library / Single Mail


Re: Why curl does CWD (was Re: Problem with subsequent persistantcalls)

From: Dimitris Sarris <>
Date: Fri, 07 Dec 2001 16:23:30 +0200

Daniel Stenberg wrote:

> > How can I perform the directory listing of a directory except for the
> > HOME?
> This is already perfectly well supported by libcurl! Just use a URL with a
> different directory than /. Try
> "ftp://localhost/very/long/path/to/my/weird/dir/and/show/it/please/".
> > Why did you implement it like this?
> Can you explain a better way to do it?
> > I suppose that it should be more suitable to first perform the CWD to
> > home, then the quoted commands and last the transfer.
> I don't think so. Because then if you do a CWD in the quoted commands, the
> transfer is destined to fail. Now, you can CWD and do whatever you want, and
> then curl will just jump to the correct directory and do the transfer.

Ok, you convinced me. When I was testing the retrieve of directory listings I
did not add the last '/', so
curl returned with error. That's why, I used the CURLOPT_QUOTE.

Thanks for your support,
Received on 2001-12-07