Safe Haskell | None |
---|---|
Language | Haskell2010 |
Random and Binary IO with generic Iteratees, using File Descriptors for IO. when available, these are the preferred functions for performing IO as they run in constant space and function properly with sockets, pipes, etc.
Synopsis
- defaultBufSize :: Int
- enumFile :: MonadBracketIO m => Int -> FilePath -> Enumerator Bytes m a
- enumFileRandom :: MonadBracketIO m => Int -> FilePath -> Enumerator Bytes m a
- enumFd :: MonadIO m => Int -> Fd -> Enumerator Bytes m a
- enumFdRandom :: MonadIO m => Int -> Fd -> Enumerator Bytes m a
Data
defaultBufSize :: Int Source #
Default buffer size in elements. This was 1024 in Data.Iteratee, which is obviously too small. Since we often want to merge many files, a read should take more time than a seek. This sets the sensible buffer size to somewhat more than one MB.
File enumerators
:: MonadBracketIO m | |
=> Int | Buffer size |
-> FilePath | |
-> Enumerator Bytes m a |
:: MonadBracketIO m | |
=> Int | Buffer size |
-> FilePath | |
-> Enumerator Bytes m a |
FileDescriptor based enumerators for monadic iteratees
enumFd :: MonadIO m => Int -> Fd -> Enumerator Bytes m a Source #
The enumerator of a POSIX File Descriptor. This version enumerates over the entire contents of a file, in order, unless stopped by the iteratee. In particular, seeking is not supported.
enumFdRandom :: MonadIO m => Int -> Fd -> Enumerator Bytes m a Source #
The enumerator of a POSIX File Descriptor: a variation of enumFd
that
supports RandomIO (seek requests).