haskus-system-0.6.0.0: Haskus system programming framework

Safe HaskellNone
LanguageHaskell2010

Haskus.Arch.Linux.FileSystem.ReadWrite

Contents

Description

Read/write

Synopsis

Documentation

data IOVec Source #

Entry for vectors of buffers

Constructors

IOVec 

Fields

Instances

Generic IOVec Source # 

Associated Types

type Rep IOVec :: * -> * #

Methods

from :: IOVec -> Rep IOVec x #

to :: Rep IOVec x -> IOVec #

Storable IOVec Source # 
type Rep IOVec Source # 
type Rep IOVec = D1 (MetaData "IOVec" "Haskus.Arch.Linux.Internals.FileSystem" "haskus-system-0.6.0.0-LVSu3PthuRFHWVZOhe7JQX" False) (C1 (MetaCons "IOVec" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "iovecPtr") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Ptr ()))) (S1 (MetaSel (Just Symbol "iovecSize") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word64))))

maxIOVec :: Word Source #

Maximum number of IOVec for writev/readv Also called UIO_MAXIOV or IOV_MAX

Read

sysRead :: MonadIO m => Handle -> Ptr () -> Word64 -> Flow m (Word64 ': ReadErrors) Source #

Read cound bytes from the given file descriptor and put them in "buf" Returns the number of bytes read or 0 if end of file

sysReadWithOffset :: MonadIO m => Handle -> Word64 -> Ptr () -> Word64 -> Flow m (Word64 ': ReadErrors') Source #

Read a file descriptor at a given position

sysReadMany :: MonadInIO m => Handle -> [(Ptr a, Word64)] -> Flow m '[Word64, ErrorCode] Source #

Like read but uses several buffers

sysReadManyWithOffset :: MonadInIO m => Handle -> Word64 -> [(Ptr a, Word64)] -> Flow m '[Word64, ErrorCode] Source #

Like readMany, with additional offset in file

handleRead :: MonadIO m => Handle -> Maybe Word64 -> Ptr () -> Word64 -> Flow m (Word64 ': ReadErrors') Source #

Read "count" bytes from a handle (starting at optional "offset") and put them at "ptr" (allocated memory should be large enough). Returns the number of bytes read or 0 if end of file

handleReadBuffer :: MonadIO m => Handle -> Maybe Word64 -> Word64 -> Flow m (Buffer ': ReadErrors') Source #

Read n bytes in a buffer

Write

sysWrite :: MonadIO m => Handle -> Ptr a -> Word64 -> Flow m '[Word64, ErrorCode] Source #

Write cound bytes into the given file descriptor from "buf" Returns the number of bytes written (0 indicates that nothing was written)

sysWriteWithOffset :: MonadIO m => Handle -> Word64 -> Ptr () -> Word64 -> Flow m '[Word64, ErrorCode] Source #

Write a file descriptor at a given position

sysWriteMany :: MonadInIO m => Handle -> [(Ptr a, Word64)] -> Flow m '[Word64, ErrorCode] Source #

Like write but uses several buffers

sysWriteManyWithOffset :: MonadInIO m => Handle -> Word64 -> [(Ptr a, Word64)] -> Flow m '[Word64, ErrorCode] Source #

Like writeMany, with additional offset in file

writeBuffer :: MonadInIO m => Handle -> Buffer -> Flow m '[(), ErrorCode] Source #

Write a buffer