cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: relative path with ftp using curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 28 Jul 2003 11:17:36 +0200 (CEST)

On Fri, 25 Jul 2003, Roth, Kevin P. wrote:

> 1. A typical FTP client permits the user to separate the hostname,
> authentication, CWD, and GET/PUT commands into separate statements. So
> CWD'ing to "/aDir/bDir/....." is easy. But the typical curl command line
> encourages the user to put everything into one string
> ("ftp://user:pass@hostname/path/to/file.txt"). This means there must exist a
> way to specify a CWD to the root of the FTP server.
>
> In my opinion, the %2F hack is un-natural, and not likely to be guessed by a
> newbie, or remembered by the average veteran. So, since the '//' hack is
> both natural and easy to remember, that approach is my preference.

I agree that // is a lot easier for the every-day user, but it is in fact not
a correct URL and that's the reason I initially thought about not allowing it.
As you know by now I changed my mind and we do allow // for the root dir
again, thanks to François Pons' patch.

> 2. Can the -X (--request) option help in this case (for specifying an extra
> CWD to the root path)? If so, can we get a working example?

No, -X is only used for directory listings when curl deals with ftp.

> 3. Can the -Q (--quote) option help? If so, can we get a working example?

Yes it can. Something like this should work:

  curl -Q "CWD /" ftp://server.com/fileinroot

> 5. Whatever your decision, the docs (in --manual), at least as of curl
> 7.10.5, need a little adjusting. Look at the following examples:

Ah, thanks. I've updated that now!

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-07-28