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

Gammon Software Solutions 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?
(New message)
Subject: Change to the way the current directory is managed in version 4.42 onwards
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by WillFa   USA  (517 posts)  [Biography] bio
Date Sun 28 Jun 2009 06:25 AM (UTC)  quote  ]
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

Posted by Nick Gammon   Australia  (19,188 posts)  [Biography] bio   Forum Administrator
Date Sun 28 Jun 2009 05:23 AM (UTC)  quote  ]
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 Nick Gammon   Australia  (19,188 posts)  [Biography] bio   Forum Administrator
Date Sun 28 Jun 2009 04:47 AM (UTC)  quote  ]
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 WillFa   USA  (517 posts)  [Biography] bio
Date Sun 28 Jun 2009 03:38 AM (UTC)  quote  ]
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 Fadedparadox   USA  (91 posts)  [Biography] bio
Date Thu 25 Jun 2009 10:46 PM (UTC)  quote  ]
Message
Awesome.
[Go to top] top

Posted by Nick Gammon   Australia  (19,188 posts)  [Biography] bio   Forum Administrator
Date Thu 25 Jun 2009 10:39 PM (UTC)  quote  ]
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

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.


2,185 views.

[New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]