>>>>> "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