I use the following to save screen output to a file
writefile("file.txt"),
tex(expression),
closefile()
The above sends the output of the tex() to the file automatically. which is all and well and what I want. (side-point: It also sends an annoying NIL line each time to the file, which I had to parse put later).
Now, when running the above code again, the file is appended to, which is not what I want. I want to either overwrite the file each time, or if there is a way to delete the file, so I can call delete on it before.
I looked at help and not able to find a command to delete a file, and I also see no option to tell writefile() to overwrite the file?
Is there an option or way around this? I am on windows 7, Maxima version: 5.36.1 Lisp: SBCL 1.2.7
I guess you are trying to capture the output of
tex
into a file. If so, here are a couple of other ways to do it:where
destination
is either a file name (which is appended) or a stream, as created byopena
oropenw
and closed byclose
. By the way,destination
could befalse
, in which casetex
returns a string.where again
destination
is either a file name (which is appended or clobbered, as determined by the global flagfile_output_append
) or a stream.with_stdout
could be useful if you want to mix in some output not generated bytex
, e.g.,print("% some commentary");
.