io: fix 'update mode to not create a file
This commit is contained in:
parent
6c435abaa7
commit
77e362b27c
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user