totalcmd.exe /O /T c:/tmp opens c:\/tmp/\*.*

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

totalcmd.exe /O /T c:/tmp opens c:\/tmp/\*.*

Post by *now »

Executing

totalcmd.exe /O /T c:/tmp

opens a tab listing the following directory:

c:\/tmp/\*.*

It seems that there’s a problem with the slash-to-backslash conversion on command-line arguments.
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Please do not use forward slash instead of backslash in Windows, applications must not support it. Sometimes it will work, sometimes not.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48203
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed forward slashes aren't officially supported in TC, except for F T P. Using them will have unpredictable results.
Author of Total Commander
https://www.ghisler.com
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Post by *now »

MVV: That’s actually wrong. Applications that make assumptions about the path separator are in the wrong.

As I understood it, 7.5 was meant to support forward slashes, but I guess this was limited to certain functions.

It seems that pathname handling should be abstracted away as far as possible, so as to allow things like this.

Anyway, I thought I’d mention it.
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

In Windows directory names divider is backslash. I don't see any reason to support forward slashes here.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3868
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

2now: I agree with MVV. This is a windows file system.

Especially at the commandline you should follow the rules:
- Backslash is a path separator
- Forward slash is used for parameter identification
#5767 Personal license
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

It is interesting though, when cd ./foo is used on a button,
The resultant path/addressBar in TC is:
m:\./foo\ ,,, when you are looking at it, AND
m:\./foo/ ... when you edit the path.

Also, after TC loses focus (minimize/restore) the path changes to:
m:\./foo/\ ... for both Viewing and Edit.

If you do cd ./foo (the same thing) at the command-line,
The resultant path/addressBar in TC is:
m:\foo\

Many things in TC would likely be resolved if a ValidatePath function was used consistently. We would also be able to get %EnvironmentVariables% back in Copy/Move dialogs.
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Post by *now »

MVV and sqa_wizard: Please get your facts straight. See http://en.wikipedia.org/wiki/Path_%28computing%29 for more information on this topic.
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

now wrote:MVV and sqa_wizard: Please get your facts straight. See http://en.wikipedia.org/wiki/Path_%28computing%29 for more information on this topic.
Please read naming conventions for Microsoft Windows: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx
I think Microsoft resource is more important in this question than Wiki.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6527
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

now wrote:MVV and sqa_wizard: Please get your facts straight. See http://en.wikipedia.org/wiki/Path_%28computing%29 for more information on this topic.
Sorry, but a Wiki article is in no way a substitute for the Filesystem definitions from Microsoft. Please accept that in Micosoft systems the forward slash on command line means parameter and is never ever part of pathnames. There are some programs which interprete it in other ways but that doesn't change the official definition.
User avatar
MVV
Power Member
Power Member
Posts: 8704
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I just want to say that Microsoft defines naming conventions. And if Microsoft says nothing about supporting forward slash as path separator, Windows applications don't require to support forward slashes here.

And, Wiki is free and open library, any people may edit it articles, so it may be wrong.
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Post by *now »

From the same article (http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx)

Note File I/O functions in the Windows API convert "/" to "\" as part of converting the name to an NT-style name, except when using the "\\?\" prefix as detailed in the following sections.

MVV and Horst.Epp: OK, so you never use Wikipedia as a reference?

MVV: Who said anything about “require”? It’s just a nice feature to have, and had the path-handling code in Total Commander been abstracted correctly then it would have been very easy to add it.

http://blogs.msdn.com/larryosterman/archive/2005/06/24/432386.aspx

Are you going to dismiss that as possibly wrong as well?

There’s a difference between convention and reality.

There is no reason for Total Commander not to support a forward slash as a path separator, except for, as far as I can tell, the lack of a uniform handling of paths in Total Commander. That that’s the real bug here.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

now wrote:There is no reason for Total Commander not to support a forward slash as a path separator,...
You forgot to quote the next two sentences from MSDN
http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#maxpath wrote:Note File I/O functions in the Windows API convert "/" to "" as part of converting the name to an NT-style name, except when using the "\\?" prefix as detailed in the following sections.

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?" prefix. For example, "\\?\D:\<very long path>". (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
TC7.5 does support unicode and paths up to 1022 characters, so maybe this is one reason?

Regards
Holger
User avatar
now
Member
Member
Posts: 181
Joined: 2006-11-01, 08:34 UTC

Post by *now »

HolgerK: We’ve already established what the convention is.

If Total Commander actually checks that each component is of lpMaximumComponentLength, then it should be easy to add support for slash as a component separator.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

now wrote:We’ve already established what the convention is.
We (!?!) or only You!

Regards
Holger
Post Reply