Page 1 of 1

Backslash should be added to cm_CopySrcPathToClip output

Posted: 2018-05-28, 08:49 UTC
by ackuxacky
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.

Re: Backslash should be added to cm_CopySrcPathToClip output

Posted: 2018-05-28, 12:05 UTC
by Sir_SiLvA
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.

Posted: 2018-05-28, 15:40 UTC
by Dalai
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

Posted: 2018-06-20, 20:10 UTC
by ackuxacky
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.

Posted: 2018-06-20, 21:06 UTC
by Dalai
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

Posted: 2018-06-20, 21:17 UTC
by Flint
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.