How to change the current working directory of FS plugin?

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
adammuelta
New Member
New Member
Posts: 1
Joined: 2019-02-19, 14:47 UTC

How to change the current working directory of FS plugin?

Post by *adammuelta »

Is there a way to change the current working directory of the FS plugin from within the plugin code?

E.g. let's say a have a plugin that connects to some external host, and every time the host is disconnected I wan't the plugin to retrn to the root directory where I display the list of available hosts.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to change the current working directory of FS plugin?

Post by *ghisler(Author) »

You have to use the LogProc to signal MSGTYPE_CONNECT to Total Commander. From the help: When MsgType==MSGTYPE_CONNECT, the string MUST have a specific format:
"CONNECT" followed by a single whitespace, then the root of the file system which was connected, without trailing backslash. Example:
CONNECT \Hostname

TC then adds a dissconnect button. When the user is in \Hostname\Subdir within the plugin and clicks "Disconnect", TC sends FsDisconnect with the path you passed via CONNECT \Hostname message, and then returns to the root of the plugin.
Author of Total Commander
https://www.ghisler.com
Post Reply