Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ Change to the way the current directory is managed in version 4.42 onwards
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 page
Posted by
| Nick Gammon
Australia (23,122 posts) 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 | Top |
|
Posted by
| WillFa
USA (525 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) 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 | Top |
|
Posted by
| WillFa
USA (525 posts) 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. | 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.
20,635 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top