cd + partially invalid paths

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

cd + partially invalid paths

Post by *MarcinW »

Let's assume that TC is installed in "C:\Program Files\Total Commander". Let's perform some tests:

1) cd "C:\Program Files\Total Commander" -> TC goes into "C:\Program Files\Total Commander".
2) cd "C:\Program Files\Total Commander\NotExistingName1" -> TC goes into "C:\Program Files\Total Commander".
3) cd "C:\Program Files\Total Commander\NotExistingName1\NotExistingName2" -> nothing happens.

So the improvement could be: TC could follow the path until the last existing name - similarly as Ctrl+D menu already does.

This could be useful when dealing with paths to uninstalled applications - we may still want to go to the folder that was containing the uninstalled application.

Regards
User avatar
white
Power Member
Power Member
Posts: 5988
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Is your suggestion for using cd on the command line?

Btw. I mentioned this behavior here.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Yes, it is about using "cd" command in TC command line.

You are right, you already described this behavior in your post (in the "Edited" frame).


As I just tested, same behavior is also when omitting double-quotes in my tests above.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I thought that TC opens last valid dir with any invalid subdirs in path... I confirm that TC does nothing if more than one invalid dir in path. Strange that I haven't noticed this behaviour before.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

If TC cannot go to
C:\Program Files\Total Commander\NotExistingName1
it assumes that NotExistingName1 could be a file, so TC goes to
C:\Program Files\Total Commander
and tries to set the cursor on NotExistingName1.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You can do it much easier: if X:\A\B\C\D exists, it is accepted, otherwise you truncate path (X:\A\B\C, X:\A\B etc) until object exists. When you found existing object, there are not so much things to do: if it is a file, you focus it, if it is a folder or archive, you focus or enter it depending on command line options.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC already does this when refreshing the current directory, and it doesn't exist any more. However, when you use "cd" to a specific location, I'm not sure that the user wants to check all parents too. Therefore this isn't currently done.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Someone may want TC to do nothing instead of opening nearest existing parent?
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

And the current behavior is inconsistent with the Ctrl+D behavior - which is in my opinion the right behavior.
Post Reply