>>> import qualified Streamly.FileSystem.Handle as Handle
Read and write byte streams and array streams to and from file handles
(
Handle).
The
TextEncoding,
NewLineMode, and
Buffering options of the underlying GHC
Handle are
ignored by these APIs. Please use
Streamly.Unicode.Stream
module for encoding and decoding a byte stream, use stream splitting
operations in
Streamly.Data.Stream to create a stream of lines
or to split the input stream on any other type of boundaries.
To set the read or write start position use
hSeek on the
Handle, the
before combinator may be used to do that
on a streaming combinator. To restrict the length of read or write use
the stream trimming operations like
take.
Note that a
Handle is inherently stateful, therefore, we
cannot use these APIs from multiple threads without serialization;
reading or writing in one thread would affect the file position for
other threads.
For additional, experimental APIs take a look at
Streamly.Internal.FileSystem.Handle module.