cm_copy / cm_copysamepanel: Bug?

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
funkymonk
Senior Member
Senior Member
Posts: 499
Joined: 2013-12-04, 09:56 UTC

cm_copy / cm_copysamepanel: Bug?

Post by *funkymonk »

Hi

the cm_copy command takes several options, including the /Ox option to specify the overwrite behavior.
Specifically, /O5 and /O6 will rename the source or the target file automatically.

Now, I wanted to use

Code: Select all

cm_copy /GO6T="."
to create a user command that simply duplicates the current file with renaming (/O6) into the same directory (/T=".") without displaying a dialog box (/G).

However, what I get is the error message "You cannot copy a file to itself!"
The point is, due to the requested renaming, I'm actually not trying to copy the file to it itself.
Thus, cm_copy should not show the error message but simply take a copy of the file with renaming.

I guess this is a bug. Otherwise, I suggest to treat /O5 and /O6 as described before and simply take a copy of the file with renaming.

---

Side note: There is a command cm_copysamepanel for which history.txt says

Code: Select all

New in Total Commander 6.0 final (17.11.03):
...
- 3 new internal commands: cm_copySamepanel, cm_copyOtherpanel, cm_createShortcuts: Same as cm_copy, but not reacting to Shift and Alt keys!
In fact, cm_copysamepanel does not seem to support any options (therefore, it is *not* the "same" as cm_copy) and thus cannot be invoked without showing the dialog or specifying the overwrite behavior. Maybe this could be changed/added as well for the parameters for which it makes sense.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_copy / cm_copysamepanel: Bug? ... or feature request

Post by *ghisler(Author) »

Please use
cm_copy /GO5T="."
instead, this works fine. The problem with O6 is that it means "Auto-rename target file". However, here the target file is the file you are trying to copy! TC tries to move it away and then copy it, which will fail because the file to copy would be no loger there.
With O5 (auto-rename copied) the new file will receive a new name.
cm_copysamepanel does not seem to support any options
Indeed only cm_copy supports parameters. The remark in under New in Total Commander 6.0 final was written at a time where cm_copy didn't yet support any paramerers.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16099
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_copy / cm_copysamepanel: Bug?

Post by *petermad »

2ghisler(Author)
ghisler(Author) wrote:With O6 (auto-rename copied) the new file will receive a new name.
shouldn't that be:
"With O5 (auto-rename copied) the new file will receive a new name."
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_copy / cm_copysamepanel: Bug?

Post by *ghisler(Author) »

Yes indeed - I have updated my post.

Moderator message from: ghisler(Author) » 2024-11-12, 15:53 UTC

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
User avatar
funkymonk
Senior Member
Senior Member
Posts: 499
Joined: 2013-12-04, 09:56 UTC

Re: cm_copy / cm_copysamepanel: Bug?

Post by *funkymonk »

Ok, makes sense. Thank you.
Post Reply