[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Change to the way the current directory is managed in version 4.42 onwards
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Change to the way the current directory is managed in version 4.42 onwards

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Thu 25 Jun 2009 10:39 PM (UTC)
Message
There have been complaints in the past about the way MUSHclient handles the current directory. Specifically, if you browse for files (eg. opening a text file, browsing for a plugin) that changes the current directory. Then, a plugin which opens a file in the current directory subsequently, may not find it.

In an attempt to address all this, version 4.42 has a major change to the way file browsing works. See the release notes for a detailed explanation (point 4 in the link below):

http://www.gammon.com.au/scripts/showrelnote.php?version=4.42&productid=0

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fadedparadox   USA  (91 posts)  [Biography] bio
Date Reply #1 on Thu 25 Jun 2009 10:46 PM (UTC)
Message
Awesome.
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #2 on Sun 28 Jun 2009 03:38 AM (UTC)
Message
So this change effectively means that these plugins will never find their file in the current directory, and the authors should be good coders and use full paths in the first place? :)



GetPluginInfo(GetPluginID(), 6):match("^(.+)\\.-$"))

will return the directory your plugin is installed.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sun 28 Jun 2009 04:47 AM (UTC)
Message
These plugins? Plugins in general I suppose.

If you browse to the plugins directory, at present, that changes the current directory to the plugins directory. However next time MUSHclient starts up, the plugins are not necessarily loaded with the plugins directory being the current one. And even if it was, doing a reload plugin, would not guarantee that.

So yes, plugins should probably use your suggested regexp to find where they are, if they need additional files in the same directory.

I'm not sure the change has made anything much worse than before.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sun 28 Jun 2009 05:23 AM (UTC)
Message
Quote:

GetPluginInfo(GetPluginID(), 6):match("^(.+)\\.-$"))


Out of curiosity, what was wrong with:


GetPluginInfo(GetPluginID(), 20)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #5 on Sun 28 Jun 2009 06:25 AM (UTC)
Message
Quote:
Then, a plugin which opens a file in the current directory subsequently, may not find it.

Those these plugins. :)

The other time I recall this issue flaring up is for someone that didn't know how to modify their Python search path for imports.


And there's nothing wrong with GetPluginInfo(id,20); I just didn't read far enough down the list to know it was there. I recalled needing a regexp to do it in the past.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,788 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]