iteratee-0.2.3: Iteratee-based I/OSource codeContentsIndex
type FileOffset = COff
myfdRead :: Fd -> Ptr CChar -> ByteCount -> IO (Either Errno ByteCount)
myfdSeek :: Fd -> SeekMode -> FileOffset -> IO (Either Errno FileOffset)
newtype Errno = Errno CInt
select'read'pending :: [Fd] -> IO (Either Errno [Fd])
type FileOffset = COffSource
myfdRead :: Fd -> Ptr CChar -> ByteCount -> IO (Either Errno ByteCount)Source
Alas, GHC provides no function to read from Fd to an allocated buffer. The library function fdRead is not appropriate as it returns a string already. I'd rather get data from a buffer. Furthermore, fdRead (at least in GHC) allocates a new buffer each time it is called. This is a waste. Yet another problem with fdRead is in raising an exception on any IOError or even EOF. I'd rather avoid exceptions altogether.
myfdSeek :: Fd -> SeekMode -> FileOffset -> IO (Either Errno FileOffset)Source
The following fseek procedure throws no exceptions.
newtype Errno Source
Haskell representation for errno values. The implementation is deliberately exposed, to allow users to add their own definitions of Errno values.
Errno CInt
show/hide Instances
select'read'pending :: [Fd] -> IO (Either Errno [Fd])Source
poll if file descriptors have something to read Return the list of read-pending descriptors
Produced by Haddock version 2.6.0