Backslash should be added to cm_CopySrcPathToClip output

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

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

Backslash should be added to cm_CopySrcPathToClip output

Post 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.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3270
Joined: 2003-05-06, 11:46 UTC

Re: Backslash should be added to cm_CopySrcPathToClip output

Post 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.
User avatar
Dalai
Power Member
Power Member
Posts: 9352
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post 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
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
ackuxacky
Junior Member
Junior Member
Posts: 43
Joined: 2012-09-28, 06:17 UTC

Post 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.
User avatar
Dalai
Power Member
Power Member
Posts: 9352
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post 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
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post 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.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
Post Reply