fixes bug 176816: &i/o-file-already-exists is now included in the

condition.
This commit is contained in:
Abdulaziz Ghuloum 2007-12-18 03:58:50 -05:00
parent cee16e7463
commit df08137b7f
3 changed files with 38 additions and 32 deletions

View File

@ -336,7 +336,7 @@
(define print-condition (define print-condition
(let () (let ()
(define (print-simple-condition x p) (define (print-simple-condition x p)
(let ([rtd (record-rtd x)]) (let f ([rtd (record-rtd x)])
(let ([name (record-type-name rtd)]) (let ([name (record-type-name rtd)])
(display name p)) (display name p))
(let ([v (record-type-field-names rtd)]) (let ([v (record-type-field-names rtd)])
@ -356,6 +356,8 @@
(write ((record-accessor rtd i) x) p) (write ((record-accessor rtd i) x) p)
(newline) (newline)
(f (+ i 1))))])))) (f (+ i 1))))]))))
;; (let ([parent (record-type-parent rtd)])
;; (when parent (f parent)))))
(define (print-condition x p) (define (print-condition x p)
(cond (cond
[(condition? x) [(condition? x)

View File

@ -1120,41 +1120,45 @@
[else (die 'port-eof? "not an input port" p)]))) [else (die 'port-eof? "not an input port" p)])))
(define io-errors-vec (define io-errors-vec
'#("unknown die" '#(#| 0 |# "unknown error"
"bad file name" #| 1 |# "bad file name"
"operation interrupted" #| 2 |# "operation interrupted"
"not a directory" #| 3 |# "not a directory"
"file name too long" #| 4 |# "file name too long"
"missing entities" #| 5 |# "missing entities"
"insufficient access privileges" #| 6 |# "insufficient access privileges"
"circular path" #| 7 |# "circular path"
"file is a directory" #| 8 |# "file is a directory"
"file system is read-only" #| 9 |# "file system is read-only"
"maximum open files reached" #| 10 |# "maximum open files reached"
"maximum open files reached" #| 11 |# "maximum open files reached"
"ENXIO" #| 12 |# "ENXIO"
"operation not supported" #| 13 |# "operation not supported"
"not enough space on device" #| 14 |# "not enough space on device"
"quota exceeded" #| 15 |# "quota exceeded"
"io die" #| 16 |# "io error"
"device is busy" #| 17 |# "device is busy"
"access fault" #| 18 |# "access fault"
"file already exists" #| 19 |# "file already exists"
"invalid file name")) #| 20 |# "invalid file name"))
(define (io-error who id err) (define (io-error who id err)
(let ([msg (let ([err (fxnot err)])
(let ([err (fxnot err)]) (let ([msg
(cond (cond
[(fx< err (vector-length io-errors-vec)) [(fx< err (vector-length io-errors-vec))
(vector-ref io-errors-vec err)] (vector-ref io-errors-vec err)]
[else "unknown die"]))]) [else "unknown error"])])
(raise (raise
(condition (condition
(make-error) (make-who-condition who)
(make-who-condition who) (case err
(make-message-condition msg) [(6 9 18) (make-i/o-file-protection-error)]
(make-i/o-filename-error id))))) [(19) (make-i/o-file-already-exists-error id)]
[else (condition)])
(make-message-condition msg)
(make-i/o-filename-error id))))))
(define block-size 4096) (define block-size 4096)
(define input-file-buffer-size (+ block-size 128)) (define input-file-buffer-size (+ block-size 128))

View File

@ -1 +1 @@
1253 1254