Red Hat Linux
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You seem to have CSS turned off.
Please don't fill out this field.
Briefly describe the problem (required):
Please provide the ad click URL, if possible:
Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25276/tests
Fixed bug in OPEN / CLOSE interaction that caused file deletion when
appending stream was closed with :ABORT T.
... BUGS entry about similar behaviour when superseding files.
... Regression test for the same.
RCS file: /cvsroot/sbcl/sbcl/tests/stream.impure.lisp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- stream.impure.lisp 5 May 2004 12:10:02 -0000 1.10
+++ stream.impure.lisp 20 May 2004 14:47:54 -0000 1.11
@@ -125,5 +125,29 @@
(assert (= 1 (file-position s))) ; unicode...
(assert (file-position s 0))))
+;;; CLOSING a non-new streams should not delete them, and superseded
+;;; files should be restored.
+(let ((test "test-file-for-close-should-not-delete"))
+ (macrolet ((test-mode (mode)
+ (catch :close-test-exit
+ (with-open-file (f test :direction :output :if-exists ,mode)
+ (write-line "test" f)
+ (throw :close-test-exit t)))
+ (assert (and (probe-file test) ,mode)))))
+ (with-open-file (f test :direction :output)
+ (write-line "test" f))
+ (test-mode :append)
+ ;; FIXME: We really should recover supersede files as well, according to
+ ;; CLOSE in CLHS, but at the moment we don't.
+ ;; (test-mode :supersede)
+ (test-mode :rename)
+ (test-mode :rename-and-delete))
+ (when (probe-file test)
+ (delete-file test)))))
(quit :unix-status 104)
Sign up for the SourceForge newsletter: