haskus-system- Haskus system programming framework

Safe HaskellNone




withOpenAt :: forall xs zs m. (Liftable OpenErrors zs, Liftable xs zs, zs ~ Union xs OpenErrors, MonadInIO m) => Handle -> FilePath -> HandleFlags -> FilePermissions -> (Handle -> Flow m xs) -> Flow m zs Source #

Open at

atomicReadBuffer :: Handle -> FilePath -> Flow Sys (Buffer ': Union ReadErrors' OpenErrors) Source #

Read a file with a single "read"

Some files (e.g., in procfs) need to be read atomically to ensure that their contents is valid. In this function, we increase the buffer size until we can read the whole file in it with a single "read" call.

readBuffer :: Handle -> Maybe Word64 -> Word64 -> Flow Sys (Buffer ': ReadErrors') Source #

Read into a buffer

readStorable :: forall a. Storable a => Handle -> Maybe Word64 -> Flow Sys (a ': ReadErrors') Source #

Read a storable