Safe Haskell | None |
---|---|
Language | Haskell2010 |
Random and Binary IO with generic Iteratees.
- defaultBufSize :: Int
- enumHandle :: (MonadIO m, MonadMask m) => Int -> Handle -> Enumerator Bytes m a
- enumHandleRandom :: forall m a. (MonadIO m, MonadMask m) => Int -> Handle -> Enumerator Bytes m a
- enumFile :: (MonadIO m, MonadMask m) => Int -> FilePath -> Enumerator Bytes m a
- enumFileRandom :: (MonadIO m, MonadMask m) => Int -> FilePath -> Enumerator Bytes m a
- enumFd :: (MonadIO m, MonadMask m) => Int -> Fd -> Enumerator Bytes m a
- enumFdRandom :: (MonadIO m, MonadMask m) => Int -> Fd -> Enumerator Bytes m a
- fileDriver :: (MonadIO m, MonadMask m) => Iteratee Bytes m a -> FilePath -> m a
- fileDriverVBuf :: (MonadIO m, MonadMask m) => Int -> Iteratee Bytes m a -> FilePath -> m a
- fileDriverRandom :: (MonadIO m, MonadMask m) => Iteratee Bytes m a -> FilePath -> m a
- fileDriverRandomVBuf :: (MonadIO m, MonadMask m) => Int -> Iteratee Bytes m a -> FilePath -> 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
Handle-based enumerators
:: (MonadIO m, MonadMask m) | |
=> Int | Buffer size (number of elements per read) |
-> Handle | |
-> Enumerator Bytes m a |
The (monadic) enumerator of a file Handle. This version enumerates over the entire contents of a file, in order, unless stopped by the iteratee. In particular, seeking is not supported. Data is read into a buffer of the specified size.
:: (MonadIO m, MonadMask m) | |
=> Int | Buffer size (number of elements per read) |
-> Handle | |
-> Enumerator Bytes m a |
The enumerator of a Handle: a variation of enumHandle that supports RandomIO (seek requests). Data is read into a buffer of the specified size.
enumFileRandom :: (MonadIO m, MonadMask m) => Int -> FilePath -> Enumerator Bytes m a Source #
FileDescriptor based enumerators
enumFd :: (MonadIO m, MonadMask 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, MonadMask m) => Int -> Fd -> Enumerator Bytes m a Source #
The enumerator of a POSIX File Descriptor: a variation of enumFd
that
supports RandomIO (seek requests).
Iteratee drivers
fileDriver :: (MonadIO m, MonadMask m) => Iteratee Bytes m a -> FilePath -> m a Source #
Process a file using the given Iteratee. This function wraps enumFd as a convenience.
fileDriverVBuf :: (MonadIO m, MonadMask m) => Int -> Iteratee Bytes m a -> FilePath -> m a Source #
A version of fileDriver with a user-specified buffer size (in elements).