From: Nikodemus S. <de...@us...> - 2009-07-31 09:11:42
|
Update of /cvsroot/sbcl/sbcl/tests In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11196/tests Modified Files: stream.impure.lisp Log Message: 1.0.30.22: better DELETE-FILE on streams * Don't close the stream on Unix, so users can enjoy the normal Unixy-IO to unlinked files. * On Windows, close the stream with :ABORT NIL, so that there is no danger of close trying to delete file as well. Bug with DELETE-FILE trying to delete files twice reported by John Fremlin. Index: stream.impure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/stream.impure.lisp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- stream.impure.lisp 4 Apr 2009 01:05:53 -0000 1.32 +++ stream.impure.lisp 31 Jul 2009 09:11:16 -0000 1.33 @@ -577,5 +577,16 @@ (assert (let ((buffer (make-array 10 :element-type '(unsigned-byte 8)))) (read-sequence buffer s)))) (delete-file pathname)) + +(with-test (:name :delete-file-on-streams) + (with-open-file (f "delete-file-on-stream-test.tmp" + :direction :io) + (delete-file f) + #-win32 + (progn + (write-line "still open" f) + (file-position f :start) + (assert (equal "still open" (read-line f))))) + (assert (not (probe-file "delete-file-on-stream-test.tmp")))) ;;; success |