Page 1 of 1

cd + partially invalid paths

Posted: 2014-01-26, 22:53 UTC
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

Posted: 2014-01-26, 23:04 UTC
by white
Is your suggestion for using cd on the command line?

Btw. I mentioned this behavior here.

Posted: 2014-01-27, 00:40 UTC
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.

Posted: 2014-01-27, 09:16 UTC
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.

Posted: 2014-01-27, 15:11 UTC
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.

Posted: 2014-01-27, 15:28 UTC
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.

Posted: 2014-01-28, 11:18 UTC
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.

Posted: 2014-01-28, 11:21 UTC
by MVV
Someone may want TC to do nothing instead of opening nearest existing parent?

Posted: 2014-01-28, 14:01 UTC
by MarcinW
And the current behavior is inconsistent with the Ctrl+D behavior - which is in my opinion the right behavior.