Copy file to a dir with subdir with a name of that file

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Copy file to a dir with subdir with a name of that file

Post by *DrShark »

Let's copy the file C:\Temp\test.txt\test.txt to the dir C:\Temp\ which also have a subdir with the name C:\Temp\test.txt\.

Important! In Cases 1, 2, 3 the dir 'C:\Temp\test.txt\' must contain only 1 file, 'test.txt'.

Case 1. Try with default settings in copy dialog:

Code: Select all

---------------------------
WARNING!
---------------------------
A directory 
C:\Temp\test.txt
already exist.

Do you want to coopy the file/dir to this subdirectory?
---------------------------
[ Yes ] [ No ]
---------------------------
-> Press 'Yes' - > Error:

Code: Select all

---------------------------
Total Commander
---------------------------
You cannot copy a file to itself!
---------------------------
ОК   
---------------------------
After pressing OK, nothing happens (file not copied).

In my opinion, after that TC have to ask user if he want to rename the copied file (see Case 4 behavior) .

Case 2. With "Auto-rename copied":
the file test(2).txt dir created in source (c:\Temp\test.txt\), not targed .

Case 3. With "Auto-rename target files".
Like in Case 1, after dialog

Code: Select all

---------------------------
Total Commander
---------------------------
You cannot copy a file to itself!
---------------------------
ОК   
--------------------------- 
nothing happens

Case 4. Add some other files to C:\Temp\test.txt\
If amount of files is copying with test.txt file,
on a moment when test.txt is copying, a dialog appears:

Code: Select all

---------------------------
Total Commander
---------------------------
Access denied on file
C:\Temp\test.txt!

---------------------------
[Skip] [Retry][Abort][Rename]
[As Administrator][All as Administrator]
---------------------------
[Rename] will allow to rename a copied file.

If user will select [As Administrator] or [All as Administrator], TC will allow user to skip a file-with-the-same-name, or to cancel the entire copying operation.

This behaviour is independent from Autorename options from F5 copy dialog.

Case 5. Interestingly, if source file name will be "Program files" and targert dir is C:\, TC will show to a user another dialog without [Rename] button:

Code: Select all

---------------------------
Total Commander
---------------------------
The file C:\Program files
 is READ ONLY!

Do you want to overwrite it anyway?
---------------------------
[Overwrite] [All] [Skip] [Cancel]
---------------------------
To get that, TC has to be launched with Admin rigths, and with file "Program files", some other files files have to be marked for copying.

--
TC 7.56a, Windows 7 SP1 64 bit
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Since DOS times if you copy a file and specify exact path of folder, file is copied into it. That's why TC tries to copy file into itself, but it can't.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

In Case 1 (default settings) that may be acceptable (however, like in Case 4, TC may ask user to manually rename a copied file).
Autorename options in F5 copy dialog must solve the problem completely, since TC first gives a new name to a source file (or target dir), and then copying a file (so the case "That's why TC tries to copy file into itself, but it can't" no longer have a place). However, like we see, Total Commander Autorename options currently are not ready for such cases.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply