get the current input file's directory




>>>>>> "pvarisco" == pvarisco  <pvarisco at libero.it> writes:
>
>    pvarisco> I mainly code my scripts with Maxima for Windows. But the 
following problem is 
>    pvarisco> general
>
>    pvarisco> I have many scripts which load a package "MyLib.mac". Both the 
scripts and 
>    pvarisco> MyLib.mac are in the folder "MyDir" which is not one of default 
file_search 
>    pvarisco> directories.
>    pvarisco> Adding MyDir to file_search_maxima isn't an option because 
MyDir is fragile: 
>    pvarisco> it can change later on and/or be copied to another computer 
(either Linux or 
>    pvarisco> Windows). So the full path of MyDir is far from a constant 
string. Of course 
>    pvarisco> you don't want to edit everytime the following line
>    pvarisco> load("d:\\dir1\\dir2\\MyDir\\MyLib")$
>    pvarisco> The only solution I can see is to retrieve (at runtime) the 
directory of the 
>    pvarisco> input script file, the one currently opened in wxMaxima.
>    pvarisco> In Mathematica you simply would do
>    pvarisco> Get["MyLib.mac", Path -> {NotebookDirectory[]}]
>
>I don't quite understand exactly what you want, but perhaps
>the variable load_pathname will help.  When you load a file,
>load_pathname is set to the full path of the file (in the file).
>Then the function pathname_directory and friends can help you extract
>out the various parts of the load_pathname.
>
>Ray
>
>_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>

I'll try to explain myself better.
The variable load_pathname has a meaning AFTER you load a library, my problem 
is BEFORE.
I don't know how  to load a package/library of mine by means of a relative 
path. The path is relative to the caller input file, i.e. the one currently 
opened by wxMaxima. I can't put explicitly the full directory of the library in 
the file_search_maxima variable because I don't khow that directory in advance.
The only thing I want to rely on, is that the library file and caller file 
have relative path to one another.

Mathematicha has the neat function "NotebookDirectory[]" for that, what about 
wxMaxima?

PV