(native-namestring truename :as-file t))
((or (not input)
(and input (eq if-does-not-exist :create))
- (and (eq direction :io) (not if-does-not-exist-given)))
+ (and (eq direction :io)
+ (not if-does-not-exist-given)))
(native-namestring physical :as-file t)))))
(flet ((open-error (format-control &rest format-arguments)
(error 'simple-file-error
:if-does-not-exist)
(cond ((eq if-does-not-exist :create)
(setf mask (logior mask sb!unix:o_creat)))
- ((not (member if-exists '(:new-version :error nil))))
+ ((not (member if-exists '(:error nil))))
;; Both if-does-not-exist and if-exists now imply
;; that there will be no opening of files, and either
;; an error would be signalled, or NIL returned
(open-error "OPEN :IF-DOES-NOT-EXIST ~s ~
:IF-EXISTS ~s will always signal an error."
if-does-not-exist if-exists))
- ((sb!unix:unix-stat namestring)
+ (truename
(if if-exists
(open-error "File exists ~s." pathname)
(return-from open)))
;;; (:error :error))
;;; collect (list 'do-open exist if-exists if-does-not-exist)))
(with-test (:name :open-never-openning)
- (flet ((do-open (existing if-exists if-does-not-exist)
+ (flet ((do-open (existing if-exists if-does-not-exist
+ &optional (direction :output))
(open (if existing
#.(or *compile-file-truename* *load-truename*)
"a-really-non-existing-file")
- :direction :output
+ :direction direction
:if-exists if-exists :if-does-not-exist if-does-not-exist)))
(assert (raises-error?
(do-open nil nil :error)))
(do-open nil :error :error)))
(assert (not
(do-open t nil nil)))
- (assert (raises-error? (do-open t :error :error)))))
+ (assert (raises-error? (do-open t :error :error)))
+
+ (assert (raises-error?
+ (do-open nil nil :error :io)))
+ (assert (not
+ (do-open nil :error nil :io)))
+ (assert (not
+ (do-open t nil :error :io)))
+ (assert (raises-error?
+ (do-open t :error nil :io)))
+ (assert (not
+ (do-open nil nil nil :io)))
+ (assert (raises-error?
+ (do-open nil :error :error :io)))
+ (assert (not
+ (do-open t nil nil :io)))
+ (assert (raises-error? (do-open t :error :error :io)))))