IO
structureThe IO structure contains exception constructors common to all the input/output structures and functors.
signature IO
structure IO
: IO
exception Io of {name : string, function : string, cause : exn}
exception BlockingNotSupported
exception NonblockingNotSupported
exception RandomAccessNotSupported
exception TerminatedStream
exception ClosedStream
datatype buffer_mode = NO_BUF | LINE_BUF | BLOCK_BUF
exception Io
name
name
component of the reader or writer.
function
cause
Some of the standard causes are:
cause
field of Io is not limited to these particular exceptions. Users who create their own readers or writers may raise any exception they like, which will be reported as the cause
field of the resulting Io exception.
exception BlockingNotSupported
cause
field of an Io exception.
exception NonblockingNotSupported
cause
field of an Io exception.
exception RandomAccessNotSupported
exception TerminatedStream
cause
field of an Io exception.
exception ClosedStream
cause
field of an Io exception.
datatype buffer_mode
Lower-level imperative, stream and primitive I/O modules will never raise a bare TerminatedStream, BlockingNotSupported, NonblockingNotSupported or ClosedStream exception; these exceptions are only used in the cause
field of the Io exception. However, any module may raise Subscript directly if given ill-formed arguments, or may raise Io with Subscript as the cause
.
It is possible that multiple error conditions hold when an IO function is called. For example, a random access call may be made on a closed stream corresponding to a device that does not support random access. The cause
reported in the generated Io exception is system-dependent.
TextIO, BinIO, IMPERATIVE_IO, STREAM_IO, PRIM_IO
Last Modified January 21, 1997
Comments to John Reppy.
Copyright © 1997 Bell Labs, Lucent Technologies