iteratee-0.3.6: Iteratee-based I/O

Data.Iteratee.IO.Fd

Contents

Description

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

File enumerators

FileDescriptor based enumerators

enumFd :: forall s el m a. (ReadableChunk s el, MonadIO m) => Fd -> EnumeratorGM s el m aSource

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.

enumFdFollow :: forall s el a. ReadableChunk s el => Fd -> EnumeratorGM s el IO aSource

The enumerator of a POSIX File Descriptor: a variation of enumFd that follows the tail of growing input.

enumFdRandom :: forall s el m a. (ReadableChunk s el, MonadIO m) => Fd -> EnumeratorGM s el m aSource

The enumerator of a POSIX File Descriptor: a variation of enumFd that supports RandomIO (seek requests)

Iteratee drivers

fileDriverFd :: (MonadIO m, ReadableChunk s el) => IterateeG s el m a -> FilePath -> m aSource

Process a file using the given IterateeGM. This function wraps enumFd as a convenience.

fileDriverFollowFd :: ReadableChunk s el => IterateeG s el IO a -> (a -> IterateeG s el IO b) -> FilePath -> IO bSource

Process a file using the given IterateeGM. This function wraps enumFdFollow as a convenience. The first iteratee is used to scan through to the end of the file, using enumFd. The second iteratee is used from then onwards on the growing tail of the file, using enumFdFollow.

fileDriverRandomFd :: (MonadIO m, ReadableChunk s el) => IterateeG s el m a -> FilePath -> m aSource

Process a file using the given IterateeGM. This function wraps enumFdRandom as a convenience.