Subject: [clisp-list] Bug with :overwrite file?

From: bruce <[email-masked]>
Date: Thu, 07 Dec 2000 19:59:34 +0800

Dear all,

It seems to me that overwriting an existing file with shorter length
gives rise to bad file.

(defun updatefile (filename obj)
;; open-with-file :if-exists :overwrite
;; prin1 obj ..
)

>(updatefile "test" '(1 2 3 4 5))
;; Writing file ...
(1 2 3 4 5)
>(updatefile "test" '(1 2 3))
;; Writing file ...
(1 2 3)
>(run-shell-command "cat test")
(1 2 3)4 5)

I'm using CLISP-2000-03-06 on Linux.

Best!

Shouxun

P.S.  Sorry I've sent two messages by mistake to Sam that should be to
the clisp-list.

--
You will have a long and unpleasant discussion with your supervisor.

---

From: Thibault Langlois <[email-masked]>
Date: Thu, 07 Dec 2000 12:13:53 +0000

> >(updatefile "test" '(1 2 3 4 5))

You must use :supersede instead of :overwrite.

Thibault Langlois