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).
We don't automatically set the CWD to equal the directory from
which the last script happened to be read (though when a script
tries to open a datafile without a path being given we'll look in
the directory where the script was found).
I'll have to try testing on Windows -- I'm not sure why your
experiment would work there ;-)
Allin.