|
From: Bastian M. <bma...@we...> - 2005-08-10 13:57:52
|
Hans-Bernhard Broeker wrote: > Bastian M=E4rkisch wrote: >=20 >> Currently tilde expansion of paths like "~/gnuplot.history" via=20 >> gp_expand_tilde() on Windows 9x will fail unless the user sets the=20 >> HOME environment variable. >=20 >=20 > And because that's bad, wgnuplot prints this message in such case,=20 > right on the startup screen: >=20 > warning: no HOME found >=20 >=20 >> The string containing the path is left unchanged and does therefore=20 >> not contain >> a valid path.=20 >=20 >=20 > There's not much that could usefully be done about that --- there's no = > single replacement that would be equally applicable for all Windows=20 > platforms. >=20 > Now that we have the code to locate a suitable fall-back location (for = > wgnuplot.ini), arguably all other state save files should go there, too= > (i.e. gnuplot.ini, the cross-session history file, and whatever else). Agreed. Possibly it would be even better to have a %APPDATA%\gnuplot directory in that case. >=20 >> 2) Use a default directory instead, where 'default' could be the curre= nt >> directory or the directory where gnuplot.exe resides.=20 >=20 >=20 > That's pretty much guaranteed to be wrong (not to mention isn't even=20 > accessible to normal users on a properly installed, modern Windows). That's why I propsed it as as a fall-back for older versions of Windows (like Win9x) only ... I would propose the following behaviour: 1) Try %HOME% directory from environment. That way gnuplot can adjust to user preferences and it won't break unix-like builds on Windows (cygwin) 2) Try SHGetSpecialFolderPath() or %APPDATA%, if available. Optionally use %APPDATA%\gnuplot directory instead. 3) Issue a warning message (no HOME found) and give up. This means gnuplot now requires HOME to be set for certain functionality. Is that reasonable now? --=20 Bastian M=E4rkisch Physikalisches Institut, Universit=E4t Heidelberg Philosophenweg 12 69120 Heidelberg Tel.: +49-6221-549239 Fax: +49-6221-549343 |