Page 1 of 1

Relative paths in WB settings

PostPosted: 31 Aug 2010, 20:02
by vsoljan
I am trying to put together portable winboard folder so everything works even if I move Winboard folder somewhere else.
This is why I am using relative paths, e.g:
/polyglotDir="." (polyglot.exe is in Winboard folder)
/defaultPathEGTB=".\egtb" (egtb folder is in Winboard folder)

In Winboard folder I have winboard.exe, polyglot.exe, egtb folder and a folder for each UCI engine.
What I have noticed is that when I use ".\egtb" for egtb path than engine does not use egtb, but when I put "..\egtb" it works.
This is a little bit confusing because it would be more logical if polyglot is in "." folder to use ".\egtb" path.
My question is - is this (egtb path being relative to engine path) intentional or bug?

Re: Relative paths in WB settings

PostPosted: 01 Sep 2010, 08:55
by H.G.Muller
This is a good point, which escaped my attention so far, because I never use EGTB.

The EGTB path is merely communicated to the engine, and it is the latter that uses it. WinBoard never accesses any EGTB by itself. So it is indeed logical that a relative path would be interpreted from the engine folder.

Now this cannot possibly work if not all engines are at the same level of the file-system tree. So I guess the WB docs should mention that the EGTB path should be an absolute path, which is what 99% of all people would do anyway, (e.g. if you use the browse button to set it, you automatically get an absolute path), but which unfortunately is of no use for what you want. In the install I distribute, WinBoard is in a sister folder of all engine folders, so indicating a file in the WinBoard folder so that engines, WinBoard and PSWBTM all get at it by the same relative path is possible with "..\WinBoard\FILENAME". By this I can allow users to install in an arbitrary location, without running into problems like you point out.

I guess it would be better if WinBoard would make any file or path name it passes to the engine absolute, even when they were given as a relative path by the user or in the ini file. For save game files (which are not passed tot he engine, but they are stored back into the ini file on saving settings) making the names absolute already seems to take place. This would apply to the egtpath argument, as well as to engine options of the -file and -path type. (UCI engines would probably not be helped much by this, as, unlike WB protocol, UCI2 does not distinguish -file and -path options from -string options, so the GUI could not know when a string passed to the engine has to be expanded as a file name or not.)