BinIO
structureThe structure BinIO provides input/output of binary data (8-bit bytes). The semantics of the various I/O operations can be found in the description of the IMPERATIVE_IO signature. The openIn and openOut functions allow the creation of binary streams to read an write file data. Certain operating systems may provide other ways to open files in operating-system-specific structures.
signature BIN_IO
structure BinIO
: BIN_IO
include IMPERATIVE_IO
sharing type StreamIO.vector = Word8Vector.vector
sharing type StreamIO.elem = Word8.word
val openIn : string -> instream
val openOut : string -> outstream
val openAppend : string -> outstream
include IMPERATIVE_IO
openIn name
openOut name
openAppend name
Beyond having the initial file position be at the end of the file, any additional properities are system and implementation dependent. On operating systems (e.g., Unix) that support ``atomic append mode,'' each (flushed) output operation to the file will be appended to the end, even if there are other processes writing to the file simultaneously. However, due to buffering, these writes need not be atomic, i.e., output from a different process may interleave the output of a single write using the stream library.
IMPERATIVE_IO, TextIO, OS.Path
Last Modified January 9, 1997
Copyright © 1996 AT&T