cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: relative path with ftp using curl

From: Roth, Kevin P. <KPRoth_at_MAPLLC.com>
Date: Fri, 25 Jul 2003 08:48:28 -0400

Couple of additional comments.

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.

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?

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

4. Would it be more palatable to add YetAnother curl.exe option, along the lines of --use-ftp-root, that would change curl's default behavior to either do a 'CWD', or at least add a 'CWD /' command before continueing on with the usual sequence?

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:

 a. In the "SIMPLE USAGE:" section. Both of these
    refer to the "root" file or directory, but in reality,
    they refer to a relative path from the user's HOME
    directory (or the path relative to wherever the FTP
    server places you upon login):

      Get the root README file from funet's ftp-server:
        curl ftp://ftp.funet.fi/README

      Get a list of the root directory of an FTP site:
        curl ftp://cool.haxx.se/

    These should perhaps say:

      Get the README file from the user's home directory
       at funet's ftp-server:

 b. This comment from the "FTP and PATH NAMES" section,
    isn't correct, according to the previous discussion
    on this thread:

      But if you want the README file from the root directory
      of that very same site, you need to specify the absolute
      file name:

        curl ftp://user:passwd@my.site.com//README

- Kevin

-------------------------------------------------------
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-25