Lister mode blocks starting of regular TC

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
ThiefMaster
Junior Member
Junior Member
Posts: 78
Joined: 2003-10-27, 16:49 UTC
Contact:

Lister mode blocks starting of regular TC

Post by *ThiefMaster »

When starting the lister with 'totalcmd.exe /S=L <somefile>' I cannot open the real TC anymore until i close the lister.
This ist most likely because I've configured TC that I only want to allow one TC instance. However, the quasi-standalone lister should not be considered as TC instance.

Additionally, a lister.exe which simply runs totalcmd in lister mode would be useful for programs where you can only specify a .exe without any arguments which will be used to open something (e.g. logfiles).
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I don't think it is so hard to specify additional parameter /S=L to start lister mode. You may create micro BAT file that will start lister mode with specified filename:

Code: Select all

@start "" %0\..\TOTALCMD.exe /S=L %1
BTW, keep in mind that you need to load new TC instance into memory to start TC in lister mode.

I recommend to use value 2, 3 or larger for OnlyOnce INI parameter (new in TC 7.55) - to allow having specified ammount of TC instances - so your TC will start even if another TC is already started in lister mode. Also you may start TC with /N parameter - to start new instance anyway.
ThiefMaster
Junior Member
Junior Member
Posts: 78
Joined: 2003-10-27, 16:49 UTC
Contact:

Post by *ThiefMaster »

I don't think you understood the problem.
Some programs do not ALLOW you to specify arguments. And such a lister.exe is written in 5 minutes.

And using a higher OnlyOnce parameter is also not really a solution: I never want more than one instance of the actual file manager. However, I don't want to limit the lister instances at all (so I'd have to disable OnlyOnce completely!) since those are not directly related to the file manager at all. I'd even use the standalone lister, but unfortunately it was abandoned long time ago...
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Feel free to use this Lister.exe (just save text into a file, decode and copy to TC directory), it will start TC in lister mode.

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="Lister.7z"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Lister.7z"

N3q8ryccAANietSrSAIAAAAAAABfAAAAAAAAAGtTqbAAJpaOcAAX9+wFu+r0/5QBL0TuTr0JP39V
wXIs+2C8FAvofZL9OQyrmdRJ6fFEUwUox4AepJrWfamkx9MSo1AMPur1FMg8of0jfCyT3T8/4QjX
pnYCV1i9CxcUJvNEOklmnQP+DzHzvphuXQcZpsZbZXCz1ZXBShMV3bCSb1Q8x/i8ZlCx9Rzf9SWS
OAFLtRQtK/eWqUXjzxT5T9OhsQUspNs8BP5nzkcN1qKHi5tgJ58Zm2SonJvlUWudAtnWNdJBHuds
l3bDm4wFNxfkx0fY0KJmpPa8iVuUafSKpl+y299wGC/pAMT5lnygpURDGLAgTIie1OAQipgxXAqh
izZOcp5PJm7a0tCryOWZ0VD/XXFK41Uj3CtoGKfAXdP0vGDyDvp2TO1PYLgX0oBK31D6OTTA2Vs2
RxRCyruvyB2gSQi7514vQrf9jBPi+g/ta5Xytc0FCTKWrBpIAB7Xbd3MRaW0oIpn4fgZniBDIE8m
r5wpTM3x8LMMpgHf4Z4DWMvas5IUzCrXRzCuZpF2BAxCR7WJ+iki8oHxta1bePs6e07g9kvx7Tx6
zGBS8IyPCs+9wmgIUFwhQjOVqFsQRU+rF9BkQEcLlU/XPor4e0AG7XNX4juY0h0dK/OnF/CY3PYQ
TUhBwubzRb2wo48rtEnoohvxam+WkHHc/U7Z1acOn+l+pcV1dmT2lcXNYjgggyxU1/qJzUUtlteu
CmGvqZ8qZ7T4RmEACxOniKj954CiuIYFSIynrNl9WLawR0HzrvTwI27K04UOAAEEBgABCYJIAAcL
AQACIwMBAQVdAAABAAQDAwEDAQAMiACIAAAICgF5Qr+WAAAFAREXAEwAaQBzAHQAZQByAC4AZQB4
AGUAAAAUCgEA8njfQ4XZygEVBgEAIAgAAAAA

Why you not using normal TC lister? As for me, I have TC running almost all time and I use F3 to start lister.
ThiefMaster
Junior Member
Junior Member
Posts: 78
Joined: 2003-10-27, 16:49 UTC
Contact:

Post by *ThiefMaster »

Thanks, but I've already written a lister.exe which starts TC in lister mode. ;)
Why you not using normal TC lister? As for me, I have TC running almost all time and I use F3 to start lister.
I use the lister as a log viewer in mIRC. In my log folder there are thousands of log files (I'm staff in a large IRC network so I join lots of channels and get pms from users - that causes lots of log files) due to this and I don't want to go to that folder, search for my file, etc. just to view a log when I can just have a command in my IRC client which opens the log file with an applications.
However, I only have TC running when I need it so it might be possible that I open a log file and then want to start TC for some reason - and that fails. However, i can start multiple TCs in lister mode which makes this behaviour even more inconsistent.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, I agree that TC shouldn't count copies started in lister, sync etc mode while loading.
But I don't know how TC determines if there is a working copy (I thought that it searches windows with "TTOTAL_CMD" class but TC in lister mode have no such window).
So, let's wait for Mr Ghisler's answer.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

When you use the option "only one copy", it allows to open additional copies of TC in Lister, Compare or Sync mode, but not other main program copies. Currently it's not possible to change it, because the detection is done via the hidden TApplication object. I will check if there is some other way, but I cannot promise anything yet.
Author of Total Commander
https://www.ghisler.com
ThiefMaster
Junior Member
Junior Member
Posts: 78
Joined: 2003-10-27, 16:49 UTC
Contact:

Post by *ThiefMaster »

What about this method?
http://support.microsoft.com/?scid=kb%3Ben-us%3B243953&x=8&y=11
Then you could simply only create/check the mutex if TC is not started in Lister mode.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

What happens when the program crashes?
Author of Total Commander
https://www.ghisler.com
ThiefMaster
Junior Member
Junior Member
Posts: 78
Joined: 2003-10-27, 16:49 UTC
Contact:

Post by *ThiefMaster »

Hrm that would be a problem..

What about sending a custom windows message to the other running TC processes. Those could send a response telling the new process what kind of TC they are (lister / regular)
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author) wrote:When you use the option "only one copy", it allows to open additional copies of TC in Lister, Compare or Sync mode, but not other main program copies. Currently it's not possible to change it, because the detection is done via the hidden TApplication object. I will check if there is some other way, but I cannot promise anything yet.
Maybe it would be easier to search for windows with class "TTOTAL_CMD"? Every main instance have such window and every lister-mode instance have no such window. I don't see any benefits to search for hidden TApplication window instead.
ThiefMaster
Junior Member
Junior Member
Posts: 78
Joined: 2003-10-27, 16:49 UTC
Contact:

Post by *ThiefMaster »

Any updates on this?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, this has been fixed in TC 7.55 a while ago.
Author of Total Commander
https://www.ghisler.com
Post Reply