On Sat, 22 Dec 2007, Riccardo (Jack) Lucchetti wrote:
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).
I think that CWD and "./" work just fine if you're launching gretl
from, e.g., the bash prompt in an xterm (as I do). You know what
the initial CWD is, and can pre-set it easily by cd'ing to your
project directory. On the other hand, I accept that it's of
questionable usefulness on Windows, where most users won't know
what the CWD is when they launch gretl (and won't even have any
means of finding out, short of typing "set" in the gretl console).
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"...
I'd really rather not get into that if possible. But here's an
idea (based on what you've suggested):
1. Let's think of what we presently call "userdir" as gretl's
"private" data directory. On Windows, we needn't offer a choice
of this directory on installation; we can just automatically use
USERAPPDATADIR/gretl (the current default). On other platforms we
can continue to default to ~/gretl (perhaps ~/.gretl would be more
appropriate but that has compatibility issues).
2. We add the concept of a user's "working directory" based on the
present value of "currdir". We can save this between sessions
(which we currently don't). We won't write any "internal" files
to this directory, but we'll make it the default for explicit
file open/save, for shell commands, and so on.
3. That leaves the question of what the "working directory" should
default to on first-time installation, i.e. before "currdir" has
been set. Here are some options:
On Windows: the Desktop, MYDOCUMENTS, MYDOCUMENTS/gretl, ??
On Linux: the CWD, HOME, HOME/gretl, ??
We could prompt for this on a first-time Windows install, but I
think that's likely to be confusing since the user probably won't
really know what's being asked at that point.
4. One more loose end: should the working dir be explicitly
settable, or should it always just be set implicitly by data or
script file open operations? Maybe we should offer something like
[] Always start in directory: _____________
That is, a check box plus a directory slot that is enabled if the
box is checked. (Rationale: a user might sometimes want to open a
data file or script from some neutral location such as the
Desktop, without thereby switching the working directory to that
location.)
Allin.