Backslash should be added to cm_CopySrcPathToClip output

Please report only one bug per message!

Moderators: Stefan2, sheep, white, Hacker

Post Reply
ackuxacky
Junior Member
Junior Member
Posts: 21
Joined: 2012-09-28, 06:17 UTC

Backslash should be added to cm_CopySrcPathToClip output

Post by ackuxacky » 2018-05-28, 08:49 UTC

Dear TC Support,

The directory name (path) misses backslash at the end of the cm_CopySrcPathToClip string output as a usual directory identification.

c:\Downloads
instead of
c:\Downloads\

A correction of a behavior levels up the user experience. Thank you for correcting the behavior.

User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 2790
Joined: 2003-05-06, 11:46 UTC

Re: Backslash should be added to cm_CopySrcPathToClip output

Post by Sir_SiLvA » 2018-05-28, 12:05 UTC

ackuxacky wrote: c:\Downloads
instead of
c:\Downloads\
No, not gonna happen.
"c:\Downloads" is the ONLY correct output.

PS: this is NOT a BUG but merly a (terrible) suggestion.

User avatar
Dalai
Power Member
Power Member
Posts: 6092
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by Dalai » 2018-05-28, 15:40 UTC

Mh, technically a path must include a trailing path delimiter, otherwise it's a directory, not a path. Compare the Delphi ExtractFilePath() and ExtractFileDir() functions, the former includes the path delimiter while the latter strips it.

However, I guess it's not a good idea to change it after so many years, also there are other commands out there that include the path delimiter, e.g. cm_CopyFullNamesToClip.

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

ackuxacky
Junior Member
Junior Member
Posts: 21
Joined: 2012-09-28, 06:17 UTC

Post by ackuxacky » 2018-06-20, 20:10 UTC

Thank you for your opinions.

I don't understand yet, whether Dalai supports the idea or not. It is true that standing on a directory and calling cm_CopyFullNamesToClip copies the directory path (name) with a trailing character. Stepping into that directory and calling cm_CopySrcPathToClip copies the directory path without any trailing character.

Where is any logic in such a behavior and why should my suggestion be a non-sense?

If cm_CopySrcPathToClip is used in any script or so, duplicate trailing characters do not introduce any flaws. C:\Downloads\ and C:\Downloads\\ are interpreted the same.

User avatar
Dalai
Power Member
Power Member
Posts: 6092
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by Dalai » 2018-06-20, 21:06 UTC

ackuxacky wrote:I don't understand yet, whether Dalai supports the idea or not.
Well, it's a simple one (for me ;)): I'll leave it to Ghisler to decide whether or not he makes any changes there. But as I already said above: I guess it's not a good idea to change it after so many years, because nobody knows which behavior other TC users rely on...
If cm_CopySrcPathToClip is used in any script or so, duplicate trailing characters do not introduce any flaws. C:\Downloads\ and C:\Downloads\\ are interpreted the same.
Nobody can say for certain that duplicate path delimiters won't cause any trouble. The problem is that you can't project the way you work on other people. Just because you won't have any trouble with duplicate path delimiters in your workflow doesn't mean that the same applies to other people and their workflow.

In the end it's Ghisler's decision.

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
Flint
Power Member
Power Member
Posts: 3141
Joined: 2003-10-27, 09:25 UTC
Location: Moscow, Russia
Contact:

Post by Flint » 2018-06-20, 21:17 UTC

I can tell for sure there are programs that don't like double back-slashes in paths. I had to fix one of my own programs that produced them, because a user reported that it was causing a problem with some other application.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, other stuff!
 
Using TC 9.20rc2 / Win7 x32 & x64 SP1

Post Reply