Page 1 of 2

TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 03:07 UTC
by andry81
  1. Create a file by long 260+ path
  2. ctrl-c + ctrl-v file in the same directory
  3. Nothing copied

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 08:58 UTC
by gdpr deleted 6
It seems the CTRL+V file paste operation is handed off to Windows, and not executed by TC itself.

If you do this CTRL+C / CTRL+V experiment with the same file in the same directory using just the Windows explorer (not using TC at all), what do you observe then? Does the paste operation succeed, or do you see an error message or anything else?

Here is why i believe that it perhaps might be more a problem related to Windows than TC: I run Win7, whose user-facing APIs do not support long paths by default. Trying to paste a file with CTRL+V that produces a long path will lead to an error dialog. That error dialog does not look like a TC dialog, but rather a lot like a Windows dialog: https://imgur.com/a/XMWAOIP . And it's exactly the same dialog i would get when trying to reproduce the problem using nothing but the Windows Explorer. Again, keep in mind i am running Win7 here whose "user-facing" APIs don't support long paths by default. I am not saying that you should see the same error dialog no matter what, as that could be dependent on the particular Windows version you are running. I am just laying out my observations that lead me to believe that TC is just handing off the CTRL+V file paste operation to Windows, and that this part of Windows executing this function in your case is staying silent about whatever error occured. But yes, there is a non-trivial level of uncertainty in my speculation, so don't take it as gospel.

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 12:07 UTC
by tuska
andry81 wrote: 2020-11-20, 03:07 UTC
  1. Create a file by long 260+ path
  2. ctrl-c + ctrl-v file in the same directory
  3. Nothing copied
I do not have this problem with these file extensions: .AHK*, .ICO, .TXT, .JPG, .BMP, .DOC, .MSG, .PNG, .URL, .LNK, PDF ** edited **
*Example [=tc.path length] = 290 characters --> .AHK file ...
AutoSwitch_2020-06-04.ahk -> AutoSwitch_2020-06-04 - Kopie.ahk -> AutoSwitch_2020-06-04 - Kopie (2).ahk

But maybe it is also because I have "LongPathsEnabled=1" in the registry.

Code: Select all

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\   LongPathsEnabled  Value: 1
With file extensions .MSG, .LNK, .PNG I get this message when I try to copy files and the files cannot be copied:
"The source and destination file names are identical".
** edited, the problem did not occur in another attempt. **

I have not tested other file extensions.

For example, I have the following entries in the [Configuration] section of the wincmd.ini file

Code: Select all

ExplorerForCopy=0
LongNameCopy=1
PS:
*If I put a '.' point in the TC command line in the path with 264 characters (= folder exclusive files) and press <enter>,
then I don't get to the folder with 264 characters in Windows Explorer but to the root directory, in this case D:\

2andry81: For such posts, data should be provided as a minimum requirement, as they can be found e.g. in my signature.


Windows 10 Pro (x64) Version 20H2 (OS build 19042.630) [... press Windows logo key + pause key] | TC 9.51 x64/x86

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 17:13 UTC
by ghisler(Author)
Yes, Ctrl+V is handled by the system via context menu "Paste" operation. I don't have any influence on its inner workings.

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 17:41 UTC
by andry81
elgonzo wrote: 2020-11-20, 08:58 UTC If you do this CTRL+C / CTRL+V experiment with the same file in the same directory using just the Windows explorer (not using TC at all), what do you observe then? Does the paste operation succeed, or do you see an error message or anything else?
Nothing happens, a file has not been copied, no errors.
tuska wrote: 2020-11-20, 12:07 UTC 2andry81: For such posts, data should be provided as a minimum requirement, as they can be found e.g. in my signature.
Windows 7 x64 SP1 [Version 6.1.7601]

I didn't test it closely, but I have to say the TC might be need to intercept the ctrl-v runtime signal. Otherwise the issue would show up time to time. Especially when the ctrl-c/v is a convenient way to copy things.

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 19:13 UTC
by gdpr deleted 6
andry81 wrote: 2020-11-20, 17:41 UTC
elgonzo wrote: 2020-11-20, 08:58 UTC If you do this CTRL+C / CTRL+V experiment with the same file in the same directory using just the Windows explorer (not using TC at all), what do you observe then? Does the paste operation succeed, or do you see an error message or anything else?
Nothing happens, a file has not been copied, no errors.
Well, that's a rather strong indication that the problem is not with TC, but with something else in your Win7 setup.

What is borked there in your Win7 machine i have no idea, though. Maybe it's some other software on your computer messing about with the Copy'n'Paste functionality, maybe it's related to the volume/drive/directory you are trying to copy from or into, maybe some tweaked registry setting that as a side effect causes this silent failure, maybe it's something else -- i am clueless :(

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 19:37 UTC
by andry81
elgonzo wrote: 2020-11-20, 19:13 UTC Well, that's a rather strong indication that the problem is not with TC, but with something else in your Win7 setup.
TC can handle `ctrl-c` + `ctrl-v` signals itself and use an internal copy method instead of the Windows Explorer context menu `Paste`.

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 19:55 UTC
by gdpr deleted 6
andry81 wrote: 2020-11-20, 19:37 UTC TC can handle `ctrl-c` + `ctrl-v` signals itself and use an internal copy method instead of the Windows Explorer context menu `Paste`.
With regard to long path support, well, yeah, as Dalai mentions below, you can use F5, SHIFT+F5 and such for copying files involving long path names. Allowing TC to do Ctrl+C / Ctrl+V with long paths in Windows versions which don't support long paths by default would be fraught with its own headache-inducing problems, as in many cases the copy target can be something else other than TC...

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 20:13 UTC
by Dalai
TC already supports long paths in the regular copy (F5) and move (F6) operations. As Ghisler said, Ctrl+C/Ctrl+V/Ctrl+X is intentionally handled by Explorer (or the shell), and that supports long paths only on Win10 (not sure which release) out of the box.

Regards
Dalai

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 20:26 UTC
by andry81
elgonzo wrote: 2020-11-20, 19:55 UTC If it is about the error message, TC is not supposed to be a band aid for borked Windows setups as an attempt to achieve the semblance of a functioning OS.
TC supposed to be a copy tool in first place, so I don't see why it should not handle ctrl-c + ctrl-v in it's own window.
elgonzo wrote: 2020-11-20, 19:55 UTC Allowing TC to do Ctrl+C / Ctrl+V with long paths in Windows versions which don't support long paths by default would be fraught with its own headache-inducing problems, as in many cases the copy target can be something else other than TC...
I've talked about the same copy target, not a something else, it's quite a different.

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 20:29 UTC
by gdpr deleted 6
andry81 wrote: 2020-11-20, 20:26 UTC I've talked about the same copy target, not a something else, it's quite a different.
If the copy target is TC itself, there is already a working alternative approach/solution for your problem: use either F5 or SHIFT+F5.

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 20:32 UTC
by andry81
elgonzo wrote: 2020-11-20, 20:29 UTC If the copy target is TC itself, there is already a working alternative approach/solution for your problem: use either F5 or SHIFT+F5.
It is not the same, it brings a dialog what I have to edit each time instead of just press ctrl-v N times.

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 20:32 UTC
by gdpr deleted 6
Since Ctrl+C / Ctrl+V go through the clipboard -- that is the expected behavior of Ctrl+C / Ctrl+V -- you cannot just declare that users will use the clipboard and Ctrl+C / Ctrl+V as you deem proper and only restricted to TC. I mean, it would be nice to be the king of the world and tell users how they should not use a feature such as Ctrl+C / Ctrl+V , but i guess this will unfortunately remain a dream...

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 20:36 UTC
by gdpr deleted 6
Maybe a usercommand and/or toolbar button calling some batch or Powershell script (which would copy a file emulating Windows' own file naming logic, or using whatever else file naming convention you prefer) could offer a solution for your problem. You could assign a hotkey to such a usercommand, allowing you to create a copy of a file with a single keystroke. Perhaps you could even assign Ctrl+V to a usercommand. (I am not sure whether you can override Ctrl+V with a hotkey for a usercommand; someone would need to try this out...)

Re: TC9.51: ctrl-c + ctrl-v does not copy a file by long 260+ path in the same directory

Posted: 2020-11-20, 20:44 UTC
by andry81
elgonzo wrote: 2020-11-20, 20:32 UTC Since Ctrl+C / Ctrl+V go through the clipboard -- that is the expected behavior of Ctrl+C / Ctrl+V -- you cannot just declare that users will use the clipboard and Ctrl+C / Ctrl+V as you deem proper and only restricted to TC. I mean, it would be nice to be the king of the world and tell users how they should not use a feature such as Ctrl+C / Ctrl+V , but i guess this will unfortunately remain a dream...
The Clipboard is just a global object accessible from any place in OS, and TC can access it on it's own. This is not about users and how they should use it or not, TC just delegates copying to Windows Explorer when can do it itself.