[More answers to your concrete proposal in another email right after
Allin Cottrell schrieb:
(3) in a shell command line ("!" or "launch")
The effect in case (3) can be controlled by
set shelldir /some/path
This "set shelldir" thing is very interesting, but it seems
undocumented!? I will think about whether it can be used to solve the
temp file location issue for py4gretl.
* In the console/script context, should we pay any attention to
the GUI configuration choice of using the @userdir or the CWD as
the default for saving files? In the GUI context, this determines
the location in the filesystem at which the File, Save dialog
points initially. This could be read over into the console/script
situation, or not.
Yes I think that would be useful and intuitive, just like the other
settings there are also honored by console/script gretl.
* Related to the above, should we make a distinction between the
filenames "foo" and "./foo" for opening a file for writing in the
Yes, please. I think we actually discussed part of this issue some time
ago when I requested a change of the store/outfile behavior and you were
so kind to do it. The "only" remaining issue is the rule for "./".
The shell itself makes no such
distinction (well, it does in the case of calling executables, but
that's not what we're talking about here).
I don't understand this, can you explain?
* As for setting shelldir as CWD on startup, what about (most?)
GUI users who don't even know what that directory is? From their
point of view we'd be better to let shelldir default to @userdir
-- or should we just assume that such users will never have
occasion to write such files anyway, so we can ignore them?
Yes I think we can, I don't see how anybody would be affected by
changing shelldir from an empty string to something else.
One point seems clear: packaged functions should never use "./"
filenames (or relative paths at all) unless they're very sure
what's implied (i.e. unless they have set shelldir or the
equivalent). Packages should not assume that the startup CWD
means anything, or is writable by the user.
Well py4gretl uses "./"! :-) Not because it's clean, but because
otherwise one would have to tell the user how to set her preferences for
file saving locations. At least that's what I thought, I realize there
are still things I don't know about gretl scripting. Maybe the shelldir
thing in combination with the @userdir variable makes it unnecessary, I
will think about it.
Thanks for reading,