How to open a file given its pathname relative to the current batch script



2009/11/24 Robert Dodier <robert.dodier at gmail.com>:
> (defun $relative_filename (name) (namestring ($filename_merge
> ($extract_filename $x) name)))

The function does it's job! However, I receive the following warning:

$EXTRACT_FILENAME
; in: LAMBDA NIL
;     (MAXIMA::$EXTRACT_FILENAME MAXIMA::$X)
;
; caught WARNING:
;   undefined variable: $X
;
; caught WARNING:
;   This variable is undefined:
;     $X
;
; compilation unit finished
;   caught 2 WARNING conditions
$RELATIVE_FILENAME

> ... although I guess I don't see a need for relative_filename;
> it seems like filename_merge + extract_filename is enough.

I I use only filename_merge to generate the first argument of
read_list, I receive the following error:

(%i12) parametri:read_list(filename_merge(extract_filename(x),musa.model))
numericalio: expected a string, instead found a ?pathname
 -- an error.  To debug this try debugmode(true);

Manuel Fiorelli