Am 22.12.2007 11:36, Riccardo (Jack) Lucchetti schrieb:
IMO both Allin and Sven make valid points. I agree with Sven that the
concept of the userdir is not useful if you prefer, as I do, to organise
your files into nicely separate subtrees. But I've never had a problem
with "./" in my scripts (I don't know what happens with Windows, though).
As for writing temporary stuff: if the user is not meant to see it ever,
then under linux (ad I suspect under other Unices too), they belong in
/tmp/, possibly under a subdir created for the occasion, say
/tmp/gretl-x6b228/. I _think_ there's something similar in windows-land,
something like "C:\Win32\Temp", but I don't know how consistent that is
across the multitude of Windows versions.
It seems the standard API function on windows for that is GetTempPath;
apart from that it may be in an environment variable "TEMP" or "TMP",
but hey -- I'm no windows developer, this is just babbling googled stuff.
Apart from that, there is also %AppData%, which (taken from a mozilla
webpage:) "is a shorthand for the Application Data path on Windows
2000/XP/Vista. To use it, click Start > Run... (use the search box on
Vista), enter %AppData% and press Enter. You will be taken to the "real"
folder, which is normally C:\Documents and Settings\[User
Name]\Application Data on Windows XP/2000, C:\users\[User
Name]\AppData\Roaming on Windows Vista."
Both approaches should also work on localized Windows versions I think.
I'm not sure if TEMP is guaranteed to exist or be user-writable, but
%AppData% is always part of the user-specific profile.
How about adding a setting for the default read/write of data & scripts?
Something like
set workdir "/my/very/custom/path/"
which would default to @userdir if unset, or to the directory gretl was
started from if a special keyword was used (like "here", or ".").
Would
this make things any better?
I'm not sure I understand -- how would that be different from the
userdir itself?
-sven