Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- module System.FS.API
- hGetAll ∷ Monad m ⇒ HasFS m h → Handle h → m ByteString
- hGetAllAt ∷ Monad m ⇒ HasFS m h → Handle h → AbsOffset → m ByteString
- hGetExactly ∷ ∀ m h. (HasCallStack, MonadThrow m) ⇒ HasFS m h → Handle h → Word64 → m ByteString
- hGetExactlyAt ∷ ∀ m h. (HasCallStack, MonadThrow m) ⇒ HasFS m h → Handle h → Word64 → AbsOffset → m ByteString
- hPut ∷ ∀ m h. (HasCallStack, Monad m) ⇒ HasFS m h → Handle h → Builder → m Word64
- hPutAll ∷ ∀ m h. (HasCallStack, Monad m) ⇒ HasFS m h → Handle h → ByteString → m Word64
API
module System.FS.API
Lazy functions
hGetAll ∷ Monad m ⇒ HasFS m h → Handle h → m ByteString Source #
Read all the data from the given file handle 64kB at a time.
Stops when EOF is reached.
∷ Monad m | |
⇒ HasFS m h | |
→ Handle h | |
→ AbsOffset | The offset at which to read. |
→ m ByteString |
Like hGetAll
, but is thread safe since it does not change or depend
on the file offset. pread
syscall is used internally.
hGetExactly ∷ ∀ m h. (HasCallStack, MonadThrow m) ⇒ HasFS m h → Handle h → Word64 → m ByteString Source #
Makes sure it reads all requested bytes. If eof is found before all bytes are read, it throws an exception.
∷ ∀ m h. (HasCallStack, MonadThrow m) | |
⇒ HasFS m h | |
→ Handle h | |
→ Word64 | The number of bytes to read. |
→ AbsOffset | The offset at which to read. |
→ m ByteString |
Like hGetExactly
, but is thread safe since it does not change or depend
on the file offset. pread
syscall is used internally.
hPut ∷ ∀ m h. (HasCallStack, Monad m) ⇒ HasFS m h → Handle h → Builder → m Word64 Source #
This function makes sure that the whole Builder
is written.
The chunk size of the resulting ByteString
determines how much memory
will be used while writing to the handle.
hPutAll ∷ ∀ m h. (HasCallStack, Monad m) ⇒ HasFS m h → Handle h → ByteString → m Word64 Source #
This function makes sure that the whole ByteString
is written.