Allin Cottrell schrieb:
On Tue, 18 Aug 2009, Sven Schreiber wrote:
> relative paths don't work for me on linux when using 'include' in
> scripts, while ironically they seem to work fine on Windows.
>
> Here's the example:
>
> <script1>
> # this script 'scriptinlevel2.inp' resides in $HOME/gretlpathtest/level2
>
include ../scriptingretlpathtest.inp
>
> print "hello"
> </script1>
>
> <script2>
> # this script 'scriptingretlpathtest.inp' resides in $HOME/gretlpathtest
>
> function pathtest(int yo)
> print "inside function"
> end function
> </script2>
>
> Now when I run the first script on linux, an error window pops up "no
> such file or directory".
Where are you running the first script from? I'm not sure why you
would expect it to work (to include the second script) unless the
CWD was $HOME/gretlpathtest/level2 (it does work in that case).
Nice theory -- but it doesn't seem to work here! As a "proof" I've
modified to first script to print the active 'workdir', and this is the
output (on Linux, gretl cvs is two days old):
gretl-Version 1.8.3cvs
Aktuelle Sitzung: 2009-08-19 10:31
# this script 'scriptinlevel2.inp' resides in $HOME/gretlpathtest/level2
? print "@workdir"
/home/svenne/gretlpathtest/level2
? include ../scriptingretlpathtest.inp
../scriptingretlpathtest.inp
Fehler bei Skriptausführung: Stopp
include ../scriptingretlpathtest.inp
(And the error window popped up.)
Apart from the possibility that I have a stupid typo somewhere in the
file names (although I double-checked), any other ideas on what could be
the problem?
thanks,
sven