[implemented i/o conditions atsmyles@earthlink.net**20101027205447] hunk ./libs/rnrs/files.scm 2 - (export file-exists? delete-file) - (import (only (gambit files) file-exists? delete-file))) + (export file-exists? delete-file +;conditions + make-i/o-error i/o-error? make-i/o-read-error i/o-read-error? make-i/o-write-error i/o-write-error? make-i/o-invalid-position-error i/o-invalid-position-error? i/o-error-position +make-i/o-filename-error i/o-filename-error? i/o-error-filename make-i/o-file-protection-error i/o-file-protection-error? make-i/o-file-is-read-only-error i/o-file-is-read-only-error? +make-i/o-file-already-exists-error i/o-file-already-exists-error? make-i/o-file-does-not-exist-error i/o-file-does-not-exist-error? make-i/o-port-error i/o-port-error? i/o-error-port + +) + (import (only (gambit files) file-exists? delete-file) (rnrs io conditions))) hunk ./libs/rnrs/io.scm 1 +;this is used by (rnrs io ports), (rnrs io simple), and (rnrs files). It is not part of the standard but I use the same rnrs namespace for convienience. +(library (rnrs io conditions) + (export make-i/o-error i/o-error? make-i/o-read-error i/o-read-error? make-i/o-write-error i/o-write-error? make-i/o-invalid-position-error i/o-invalid-position-error? i/o-error-position +make-i/o-filename-error i/o-filename-error? i/o-error-filename make-i/o-file-protection-error i/o-file-protection-error? make-i/o-file-is-read-only-error i/o-file-is-read-only-error? +make-i/o-file-already-exists-error i/o-file-already-exists-error? make-i/o-file-does-not-exist-error i/o-file-does-not-exist-error? make-i/o-port-error i/o-port-error? i/o-error-port) + (import (rnrs conditions (6))) + + (define-condition-type &i/o &error make-i/o-error i/o-error?) + (define-condition-type &i/o-read &i/o make-i/o-read-error i/o-read-error?) + (define-condition-type &i/o-write &i/o make-i/o-write-error i/o-write-error?) + (define-condition-type &i/o-invalid-position &i/o make-i/o-invalid-position-error i/o-invalid-position-error? (position i/o-error-position)) + (define-condition-type &i/o-filename &i/o make-i/o-filename-error i/o-filename-error? (filename i/o-error-filename)) + (define-condition-type &i/o-file-protection &i/o-filename make-i/o-file-protection-error i/o-file-protection-error?) + (define-condition-type &i/o-file-is-read-only &i/o-file-protection make-i/o-file-is-read-only-error i/o-file-is-read-only-error?) + (define-condition-type &i/o-file-already-exists &i/o-filename make-i/o-file-already-exists-error i/o-file-already-exists-error?) + (define-condition-type &i/o-file-does-not-exist &i/o-filename make-i/o-file-does-not-exist-error i/o-file-does-not-exist-error?) + (define-condition-type &i/o-port &i/o make-i/o-port-error i/o-port-error? (port i/o-error-port))) + hunk ./libs/rnrs/io.scm 20 - (export eof-object eof-object? port? input-port? output-port? (rename (call-with-output-string call-with-output-string-port))) + (export eof-object eof-object? port? input-port? output-port? (rename (call-with-output-string call-with-output-string-port)) +;conditions + make-i/o-error i/o-error? make-i/o-read-error i/o-read-error? make-i/o-write-error i/o-write-error? make-i/o-invalid-position-error i/o-invalid-position-error? i/o-error-position +make-i/o-filename-error i/o-filename-error? i/o-error-filename make-i/o-file-protection-error i/o-file-protection-error? make-i/o-file-is-read-only-error i/o-file-is-read-only-error? +make-i/o-file-already-exists-error i/o-file-already-exists-error? make-i/o-file-does-not-exist-error i/o-file-does-not-exist-error? make-i/o-port-error i/o-port-error? i/o-error-port +) hunk ./libs/rnrs/io.scm 27 - (rnrs base)) + (rnrs base) + (rnrs io conditions)) hunk ./libs/rnrs/io.scm 34 - eof-object eof-object? call-with-input-file call-with-output-file input-port? output-port? current-input-port current-output-port current-error-port with-input-from-file with-output-to-file open-input-file open-output-file close-input-port close-output-port read-char peek-char read display newline write write-char) + eof-object eof-object? call-with-input-file call-with-output-file input-port? output-port? current-input-port current-output-port current-error-port with-input-from-file with-output-to-file open-input-file open-output-file close-input-port close-output-port read-char peek-char read display newline write write-char +;conditions + make-i/o-error i/o-error? make-i/o-read-error i/o-read-error? make-i/o-write-error i/o-write-error? make-i/o-invalid-position-error i/o-invalid-position-error? i/o-error-position +make-i/o-filename-error i/o-filename-error? i/o-error-filename make-i/o-file-protection-error i/o-file-protection-error? make-i/o-file-is-read-only-error i/o-file-is-read-only-error? +make-i/o-file-already-exists-error i/o-file-already-exists-error? make-i/o-file-does-not-exist-error i/o-file-does-not-exist-error? make-i/o-port-error i/o-port-error? i/o-error-port + +) hunk ./libs/rnrs/io.scm 42 - (rnrs base)) + (rnrs base) + (rnrs io conditions))