To all plugin devs:
I have had two plugins (one of my own) break after build 1148+ (I actually first found it in b1151, but was told by someone it started in b1148). The reason for the "break" is that FAR no longer sets the current working directory of the process to that of the active panel (or changes it when a plugin runs?). This means that using a filename from the active panel (without prefixing with the path) results in a "file not found" - I didn't check what the CWD was, but it is definitely not the current panel.
I don't know if this is intentional or a bug...couldn't find anything about it in the changelog (which I had to translate from russion, so it may be there). But this is a fairly big change that could potentially break any existing plugin that accesses selected items or all items in the current panel (where I used to assume, correctly, that it was the current working directory).
Anyway, to circumvent this I just manually set the current working directory upon startup of my plugin and the rest of the code could run unchanged.
Assume Nothing...Trust No One
Far 2 build 1148+ Warning for Plugin Developers
-
- Posts: 726
- Joined: Sun 03 Apr, 2005 22:00
- Location: Казань
- Been thanked: 2 times
Re: Far 2 build 1148+ Warning for Plugin Developers
http://farchangelog.blogspot.comfree3dom wrote:couldn't find anything about it in the changelog (which I had to translate from russion, so it may be there).
the post for build #1145.
- HaRT
- Moderator
- Posts: 10869
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
Re: Far 2 build 1148+ Warning for Plugin Developers
This is intentional; see b.1145 at http://farchangelog.blogspot.com/2009/09/11451148.html.free3dom wrote:I don't know if this is intentional or a bug
Please note that your code will probably fail on long paths due to SetCurrentDirectory limitations.free3dom wrote:Anyway, to circumvent this I just manually set the current working directory upon startup of my plugin and the rest of the code could run unchanged.
Фар есть инструмент, а не нянька. © 2009 DrKnS
Re: Far 2 build 1148+ Warning for Plugin Developers
Thanks for the replies, never knew about the english changelog...that'll be handy
I am aware that the SetCurrentDirectory is limited to MAX_PATH, and merely used it as 'quick fix' since I didn't
know whether or not the change was intentional (or permanent). Knowing that it is, I can now do it properly
using the path prefix for files.
I am aware that the SetCurrentDirectory is limited to MAX_PATH, and merely used it as 'quick fix' since I didn't
know whether or not the change was intentional (or permanent). Knowing that it is, I can now do it properly
using the path prefix for files.