+FTP: no overwrite dialog on rename
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
OK, I have added this now for renaming single files! Now when the user confirms the rename but it fails, TC will delete the target and try again.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Seems to work fine in TC 8.51b3 both for rename conflicts in same folder and for conflicts with files in parent folder or subfolder 

License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks for testing it! If all works well and no bugs are found, I will use this also when renaming multiple files.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I tested it a little. Basic stuff works well:
[ok] Question on rename when target exists in current directory
[ok] Question on rename when target exists in another directory (not a bad idea with SIZE command :)
[ok] Question on upload to another directory when target exists
[ok] Deleting existing target when server does not support rename overwrites
But there are some problems with permissions, these were tested with IIS FTP:
Or another problem, this one is with vsftpd, but unfortunately TC can't do much here:
But even though deleting the target file and not finishing renaming of source might look bad, user already agreed that target can be overwritten, so it's not such a big deal.
[ok] Question on rename when target exists in current directory
[ok] Question on rename when target exists in another directory (not a bad idea with SIZE command :)
[ok] Question on upload to another directory when target exists
[ok] Deleting existing target when server does not support rename overwrites
But there are some problems with permissions, these were tested with IIS FTP:
Code: Select all
// RO source, existing RW target
SIZE ../readwrite/target.txt
213 0
//TC message: overwrite? - user:yes
RNFR source.txt
550
//!!!bug#1: TC should stop here and show error
DELE ../readwrite/source.txt
250 DELE command successful.
RNFR source.txt
550
//TC message: rename failed!
Code: Select all
// RW source, existing RO target
SIZE ../readonly/target.txt
213 0
//TC message: overwrite? - user:yes
RNFR source.txt
350 Requested file action pending further information.
RNTO ../readonly/source.txt
550
DELE ../readonly/source.txt
550
//!!!bug#2: TC does not show any error
Code: Select all
// RO source, existing RO target
SIZE ../readonly/target.txt
213 0
//TC message: overwrite? - user:yes
RNFR source.txt
550
//!!!bug#1: TC should stop here and show error
DELE ../readonly/target.txt
550
//!!!bug#2: TC does not show any error; but in this case it shouldn't get so far anyway
Code: Select all
// RO source, existing RW target
SIZE ../readwrite/target.txt
213 0
//TC message: overwrite? - user:yes
RNFR source.txt
350 Ready for RNTO.
//oh sure, the file is read only, but why not promise client that server will try to rename it anyway...
RNTO ../readwrite/target.txt
550 Rename failed.
//TC: hmmm, server probably doesn't support rename overwrites
DELE ../readwrite/target.txt
250 Delete operation successful.
//TC: target cleared, lets try again
RNFR source.txt
350 Ready for RNTO.
RNTO ../readwrite/target.txt
550 Rename failed.
//TC: whoops! what happened?
//TC message: rename failed!
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
It's indeed a good idea to detect a RNFR error separately - currently TC only tests whether the entire rename operation failed. But in the second case, TC cannot know why RNTO failed.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact: