From c44f2e6960733edc383244f3e39db3b6581255c4 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 27 Jan 2004 12:02:43 +0000 Subject: [PATCH] 0.8.7.23: Fix some OPEN tests ... :DIRECTION :IO didn't work if the file didn't exist, despite default being :CREATE ... adjust filesys test to cope with new disallowed :WILD-INFERIORS :UP ... we still fail some OPEN tests in PFD's suite: some are because of not supporting (unsigned-byte 33) streams, while the rest are because DIRECTORY is broken on logical pathnames, *sigh* --- NEWS | 2 ++ contrib/sb-simple-streams/internal.lisp | 2 ++ src/code/fd-stream.lisp | 2 ++ tests/filesys.test.sh | 2 ++ tests/stream.impure.lisp | 11 +++++++++++ version.lisp-expr | 2 +- 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ea7f17a..9ac0efe 100644 --- a/NEWS +++ b/NEWS @@ -2283,6 +2283,8 @@ changes in sbcl-0.8.8 relative to sbcl-0.8.7: ** Attempting to use standardized file system operators with a pathname with invalid :DIRECTORY components signals a FILE-ERROR. + ** OPEN :DIRECTION :IO no longer fails to work on non-existent + files. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/contrib/sb-simple-streams/internal.lisp b/contrib/sb-simple-streams/internal.lisp index f8afe67..e5e926e 100644 --- a/contrib/sb-simple-streams/internal.lisp +++ b/contrib/sb-simple-streams/internal.lisp @@ -473,6 +473,8 @@ (declare (type sb-int:index mask)) (let ((name (cond ((sb-int:unix-namestring pathname input)) ((and input (eq if-does-not-exist :create)) + (sb-int:unix-namestring pathname nil)) + ((and (eq direction :io) (not if-does-not-exist-given)) (sb-int:unix-namestring pathname nil))))) ;; Process if-exists argument if we are doing any output. (cond (output diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index 2dee43a..3c2f286 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -1106,6 +1106,8 @@ (namestring (cond ((unix-namestring pathname input)) ((and input (eq if-does-not-exist :create)) + (unix-namestring pathname nil)) + ((and (eq direction :io) (not if-does-not-exist-given)) (unix-namestring pathname nil))))) ;; Process if-exists argument if we are doing any output. (cond (output diff --git a/tests/filesys.test.sh b/tests/filesys.test.sh index 3580d86..4d78f7d 100644 --- a/tests/filesys.test.sh +++ b/tests/filesys.test.sh @@ -177,11 +177,13 @@ Lisp filename syntax idiosyncrasies)." (need-match "animal/vertebrate/**/*.*" vertebrates) (need-match "animal/vertebrate/mammal/../**/*.*" vertebrates) (need-match "animal/vertebrate/mammal/../**/**/*.*" vertebrates) + #+nil (need-match "animal/vertebrate/mammal/mythical/../**/../**/*.*" vertebrates)) (need-match "animal/vertebrate/**/robot.*" nil) (need-match "animal/vertebrate/mammal/../**/*.robot" nil) (need-match "animal/vertebrate/mammal/../**/robot/*.*" nil) + #+nil (need-match "animal/vertebrate/mammal/robot/../**/../**/*.*" nil)) (need-matches) (sb-ext:quit :unix-status 52) diff --git a/tests/stream.impure.lisp b/tests/stream.impure.lisp index 71a7a8c..9b671c5 100644 --- a/tests/stream.impure.lisp +++ b/tests/stream.impure.lisp @@ -93,5 +93,16 @@ (with-open-file (s p) (assert (string= (read-line s) "THESE INSERTMBOLS"))) (delete-file p)) + +;;; :DIRECTION :IO didn't work on non-existent pathnames +(let ((p "direction-io-test")) + (ignore-errors (delete-file p)) + (with-open-file (s p :direction :io) + (format s "1") + (finish-output s) + (file-position s :start) + (assert (char= (read-char s) #\1))) + (delete-file p)) + ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 9b5b5f3..2b76a5d 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.7.22" +"0.8.7.23" -- 1.7.10.4