Re: Stringout with append



Hello Ayotunde,

> Is it possible to stringout to an existing file in append mode? That is, w/o
> overwriting the content.

There is no option or flag to change the behavior of stringout.

I think stringout should append to the file by default.
Unless I hear otherwise I'll commit a change so that
it appends to the output file.

We might also discuss whether there should be a flag of some
kind to govern whether stringout, save, and some/all other
file-writing functions append or clobber.

In the meantime here is a 1-line patch for maxima/src/suprv1.lisp.
Find suprv1.lisp in your Maxima distribution, change it as
indicated below, then load(suprv1); in Maxima should load
the modified version.

Sorry for the bother, & hope this helps,
Robert Dodier

Index: suprv1.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/suprv1.lisp,v
retrieving revision 1.27
diff -u -r1.27 suprv1.lisp
--- suprv1.lisp 4 Sep 2005 00:56:27 -0000       1.27
+++ suprv1.lisp 25 Oct 2005 15:05:20 -0000
@@ -996,7 +996,7 @@
          (let (file maxima-error l1 truename)
            (setq file ($filename_merge (car x)))
            (setq x (cdr x))
-           (with-open-file (savefile file :direction :output)
+           (with-open-file (savefile file :direction :output
:if-exists :append)
              (cond ((null
                      (errset
                       (do ((l x (cdr l)))( (null l))