Menu

#432 --request / -X not recognized with ftp url

closed-invalid
ftp (93)
5
2013-06-21
2004-07-07
Anonymous
No

curl 7.12.0 (i386-pc-win32) libcurl/7.12.0 zlib/1.2.1
Protocols: ftp gopher telnet dict ldap http file
Features: libz

Hi,

I'm trying to rename a file before downloading it.
I thought that -X (or --request) will allow me to rename
the file before getting it, but the -X in the following
command return
curl: (19) Syntax error, Command not recognized.

.\curl -X ls -u xxx:xxx ftp://host/dir/
.\curl --request ls -u xxx:xxx ftp://host/dir/

I ultimatly want to :
.\curl -X "ren a.txt a_old.txt" -u xxx:xxx ftp://host/dir/
.\curl -u xxx:xxx ftp://host/dir/a_old.txt

Regards,
Hadar

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2004-07-14
    • status: open --> closed
     
  • Daniel Stenberg

    Daniel Stenberg - 2004-07-14
    • status: closed --> closed-invalid
     
  • Daniel Stenberg

    Daniel Stenberg - 2004-07-14

    Logged In: YES
    user_id=1110

    'ls' is not a recognized FTP command, see RFC959.

     
  • Daniel Stenberg

    Daniel Stenberg - 2004-07-14

    Logged In: YES
    user_id=1110

    Oh, and read up on the -Q option.

     
  • Ale Vesely

    Ale Vesely - 2007-06-09

    Logged In: YES
    user_id=262065
    Originator: NO

    I'm not sure if this is the same bug, but the effect is the same, and since it is
    still open I add to this rather than opening a new bug...

    If I run an ftp session (with -Q commands) without specifying a target file I get
    a LIST of a possibly long directory. According to the man page, using -X should
    replace LIST with a custom command. It does not work, as the following captured
    terminal shows:

    D:\tmp>curl -v -u xxx -X NOOP ftp://abcd.tana.it/tmp/ -Q "-RNFR foo.tmp" -Q "-RNTO foo.dat"
    Enter host password for user 'xxx':* About to connect() to abcd.tana.it port 21
    (#0)
    * Trying 194.243.254.xyz... connected
    * Connected to abcd.tana.it (194.243.254.xyz) port 21 (#0)
    < 220 My ftp server ready
    > USER xxx
    < 331 Password required for xxx.
    > PASS ********
    < 230 User xxx logged in.
    > PWD
    < 257 "/home/xxx" is current directory.
    * Entry path is '/home/xxx'
    > CWD tmp
    < 250 CWD command successful.
    > EPSV
    * Connect data stream passively
    < 500 'EPSV': command not understood.
    * disabling EPSV usage
    > PASV
    < 227 Entering Passive Mode (194,243,254,xyz,14,98)
    * Trying 194.243.254.xyz... connected
    * Connecting to 194.243.254.xyz (194.243.254.xyz) port 3682
    > TYPE A
    < 200 Type set to A.
    > NOOP
    < 200 NOOP command successful.
    * RETR response: 200
    * Remembering we are in dir tmp/
    * Connection #0 to host north.tana.it left intact
    curl: (19) RETR response: 200
    > QUIT
    < 221-You have transferred 0 bytes in 0 files.
    < 221-Total traffic for this session was 396 bytes in 0 transfers.
    < 221-Thank you for using the FTP service on abcd.tana.it.
    < 221 Goodbye.
    * Closing connection #0

    Notice that RETR is causing an exit status of 19 although it is
    actually never issued to the ftp server: the trace shown above is
    correct and NOOP was the last command (before QUIT).

    D:\tmp>curl -V
    curl 7.16.2 (i586-pc-mingw32msvc) libcurl/7.16.2 zlib/1.2.2
    Protocols: tftp ftp telnet dict ldap http file
    Features: Largefile NTLM SSPI libz

     
MongoDB Logo MongoDB