kio_ftp rename

Roger Larsson roger.larsson at norran.net
Fri Jun 6 23:02:15 BST 2003


Hi,

Remembered a bug that has hit me on several occasions when
uploading files to http server.

The copy works OK.
But the rename from <file>.part to <file> fails.

Now I checked ftp.cc and noticed that it uses:
 RNFR <filepath>.part
 RNTO <filepath>
I guess that it is expected to work on all ftp servers but
it does not...

  350 File exists, ready for destination name
  550 rename: No such file or directory.

It is some kind of Unix ftp server:
ftp> system
215 UNIX Type: L8 Version: BSD-199506

But it is old:
  "FTP server ((Version 1) 20001106-07:23:35) ready."

After some digging I have found out that the server does not
implement the latest rfc
  http://www.faqs.org/rfcs/rfc959.html
but the earlier:
  http://www.faqs.org/rfcs/rfc765.html
         RENAME FROM (RNFR)

            This command specifies the file which is to be renamed.
            This command must be immediately followed by a "rename to"
            command specifying the new file pathname.

         RENAME TO (RNTO)

            This command specifies the new pathname of the file
            specified in the immediately preceding "rename from"
            command.  Together the two commands cause a file to be
            renamed.

  Note:RNFR can not take a filepath, it accepts it, but if will later
  fail the RNTO command (that can take a filepath)

Is this problem common enough to warrant a patch?
(split filepath for RNFR and execute two commands:
 "CWD path",
 "RNFR file")

/RogerL

-- 
Roger Larsson
SkellefteƄ
Sweden




More information about the kfm-devel mailing list