Hello,
Often when I run a long maxima session, I load many previously
defined *.mac files. I would like to know which ones have been
loaded in the session.
Of course, I can do a 'stringout' of the input, and read the resulting
file, but that will have a lot of other junk in it.
I wrote the following simple functions, mload and loaded_files() to
a. save the filenames loaded at load time, and
b. read the names of the loaded files.
The problem is that I use the 'read_list' function, and when it reads
the file names is separates them into little pieces. I can still tell
what they were, but I would like to know if there is a simple change
to these scripts so that the filenames listed will be written as
single strings.
Thanks for any ideas.
-sen
Here are the two functions 'mload' and 'loaded_files()'
mload(filename):= block([s_1, fl_1],
fl_1: opena("loaded_file_names"),
s_1: load(filename), printf(fl_1, "~s", s_1),
close(fl_1))$
/* 'loaded_files()' is a command which reads the contents of
'loaded_file_names' into a list */
loaded_files():= read_list("loaded_file_names")$
Here is a sample session. There is a file "file_name.mac" which has
the single command
print("Hello");
in it.
(%i8) system("ls file_name.mac");
file_name.mac
(%o8) #<process 13338 :EXITED>
(%i9) mload("file_name.mac");
Hello
(%o9) true
(%i10) loaded_files();
(%o10) [file_name, ., mac]
Notice how the name gets parsed into three substrings. I want a single
string like
"file_name.mac" or ./file_name.mac
--
---------------------------------------------------------------------------
| Sheldon E. Newhouse | e-mail: sen1 at math.msu.edu |
| Mathematics Department | |
| Michigan State University | telephone: 517-355-9684 |
| E. Lansing, MI 48824-1027 USA | FAX: 517-432-1562 |
---------------------------------------------------------------------------