How to open a file given its pathname relative to the current batch script
Subject: How to open a file given its pathname relative to the current batch script
From: Manuel Fiorelli
Date: Mon, 23 Nov 2009 23:39:47 +0100
2009/11/23 Robert Dodier <robert.dodier at gmail.com>:
> Try this: append the path to file_search_maxima, then call file_search
> to return the path for the data file.
>
> e.g.
>
> file_search_maxima : cons ("/my/path/###", file_search_maxima);
> file_search ("my.data");
> ?=> /my/path/my.data
> read_list (file_search ("my.data"));
> ?=> (stuff)
Thanks for the answer. However, this requires I know "/my/path".
Unfortunately, I wrote a file, script.mac, which needs to
read a file, a.txt, located in the same folder, which I don't like to
be hard-coded. I'd like to run wxMaxima and choose "Batch file..." to
run the script irrespectively of its position.
Manuel Fiorelli