Read data from an Fd and convert it to a ByteString. Throws an exception if this is an invalid descriptor, or EOF has been reached. This is a thin wrapper around fdRead.
Moduleunix-bytestring-0.4.0.1Haskell2010
System.Posix.IO.ByteString.Ext.Lazy
Provides a lazy-ByteString variant of System.Posix.IO.ByteString.Ext,
to avoid boilerplate code for converting between lazy-ByteString
and strict [ByteString]. This module was renamed in
version 0.4.0 to mirror the renaming of the strict module.
See the documentation there for the reason why.
- 4 values
- Packageunix-bytestring-0.4.0.1
- Exports4
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceLazy.hs
I/O with file descriptors
0 declarationsReading
fdPread :: Fd-> ByteCountHow many bytes to try to read.
-> FileOffsetWhere to read the data from.
-> IO ByteStringThe bytes read.
Read data from a specified position in the Fd and convert
it to a ByteString, without altering the position stored
in the Fd. Throws an exception if this is an invalid descriptor,
or EOF has been reached. This is a thin wrapper around
fdPread.
Since: 0.3.1
Writing
fdWrites :: Fd-> ByteStringThe string to write.
-> IO (ByteCount, ByteString)How many bytes were actually written, and the remaining (unwritten) string.
Write a ByteString to an Fd. This function makes one
write(2) system call per chunk, as per fdWrites.
fdWritev :: Fd-> ByteStringThe string to write.
-> IO ByteCountHow many bytes were actually written.
Write a ByteString to an Fd. This function makes a
single writev(2) system call, as per fdWritev.