Menu

#48 multiple Quote commands to ftp

closed-fixed
nobody
ftp (93)
6
2013-06-21
2000-12-15
No

The way to specify multiple Quote commands is NOT clear from
the documentation. So I assumed that multiple -Q switches
on the commandline should be fine, but no luck!

See the log of a session in which I tried to rename a file
on a remote server

% curl -v -u mvr707:pas ftp://serv/ -Q 'RNFR asd' -Q 'RNTO bsd'

< 220 serv FTP server (SunOS 5.7) ready.
> USER mvr707
< 331 Password required for mvramana.
> PASS pas
< 230 User mvr707 logged in.
* We have successfully logged in
* Connected to stealth (11.18.91.6)
> RNFR asd
< 350 File exists, ready for destination name
curl: (21) QUOT string not accepted: RNFR asd

%

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2000-12-16

    Yes, that's wrong behaviour. Apply this patch to improve curl! Thanks for reporting!

    diff -u -r1.36 ftp.c
    --- ftp.c 2000/11/30 21:59:51 1.36
    +++ ftp.c 2000/12/16 10:33:33
    @@ -535,7 +535,7 @@
    if(nread < 0)
    return CURLE_OPERATION_TIMEOUTED;

    - if (buf[0] != '2') {
    + if (ftpcode >= 400) {
    failf(data, "QUOT string not accepted: %s",
    qitem->data);
    return CURLE_FTP_QUOTE_ERROR;
    @@ -589,7 +589,7 @@
    if(nread < 0)
    return CURLE_OPERATION_TIMEOUTED;

    - if (buf[0] != '2') {
    + if (ftpcode >= 400) {
    failf(data, "QUOT string not accepted: %s",
    qitem->data);
    return CURLE_FTP_QUOTE_ERROR;

     
  • Daniel Stenberg

    Daniel Stenberg - 2000-12-16
    • priority: 5 --> 6
    • status: open --> closed-fixed
     
  • Nobody/Anonymous

    Hey..this problem is fixed in 7.5.2 - thanks

    I tried renaming the file 'asd' to 'bsd' as

    % curl -u ...:... ftp://fff.com/ -Q 'RNFR asd' -Q 'RNTO bsd'

    It may be good idea to explicity document that multple -Q commands can be give and are executed Left to Right

    Aside: What if we just wanted to rename and NOT anything else? The above command also gives me a listing - wasteful datatransfer!

     
MongoDB Logo MongoDB