diff --git a/pkgs/racket-test-core/tests/racket/file.rktl b/pkgs/racket-test-core/tests/racket/file.rktl index 3a9e12c5a0..a00f172330 100644 --- a/pkgs/racket-test-core/tests/racket/file.rktl +++ b/pkgs/racket-test-core/tests/racket/file.rktl @@ -334,6 +334,11 @@ (define tempfilename (make-temporary-file)) (when (file-exists? tempfilename) (delete-file tempfilename)) + +(err/rt-test (open-output-file tempfilename #:exists 'update) exn:fail:filesystem?) +(test #t output-port? (open-output-file tempfilename #:exists 'can-update)) +(delete-file tempfilename) + (let ([p (open-output-file tempfilename)]) (err/rt-test (write-special 'foo p) exn:application:mismatch?) (test #t integer? (port-file-identity p)) diff --git a/racket/src/io/port/file-port.rkt b/racket/src/io/port/file-port.rkt index 4cbd2b8607..8d7678aabc 100644 --- a/racket/src/io/port/file-port.rkt +++ b/racket/src/io/port/file-port.rkt @@ -63,8 +63,8 @@ RKTIO_OPEN_CAN_EXIST)] [(must-truncate) (+ RKTIO_OPEN_TRUNCATE RKTIO_OPEN_MUST_EXIST)] - [(update) RKTIO_OPEN_CAN_EXIST] - [(must-update) RKTIO_OPEN_MUST_EXIST] + [(can-update) RKTIO_OPEN_CAN_EXIST] + [(update) RKTIO_OPEN_MUST_EXIST] [(append) RKTIO_OPEN_APPEND] [else 0])) (define (mode? v)