Raw I/O library proposal, second (more pragmatic) draft

Ben Rudiak-Gould benrg@dark.darkweb.com
Thu, 7 Aug 2003 09:49:43 -0700 (PDT)


On Wed, 6 Aug 2003, Simon Marlow wrote:

> -- TODO: what if a file refers to a FIFO?
> fileInputStream  :: File -> FileOffset -> IO FileInputStream
> fileOutputStream :: File -> FileOffset -> IO FileOutputStream

Part of my original design was that File values always refer to
random-access files. Most of the operations on Files make no sense with
anything else. openFile might succeed on something like /dev/kmem
(although I'm not convinced that this is type-safe :-), but to open a FIFO
you had to use openXputStream instead. This avoids the questions raised by
using the functions above on non-seekable handles (What would the
FileOffset argument mean? and What happens if you put more than one input
or output stream on the same FIFO?).


-- Ben