| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.IO
Synopsis
- type FHandle = HandleOS Fd
- open :: FilePath -> OpenMode -> IO Fd
- truncate :: FHandle -> Word64 -> IO ()
- seek :: FHandle -> SeekMode -> Int64 -> IO ()
- read :: FHandle -> Word64 -> IO ByteString
- pread :: FHandle -> Word64 -> Word64 -> IO ByteString
- write :: FHandle -> Ptr Word8 -> Int64 -> IO Word32
- close :: FHandle -> IO ()
- getSize :: FHandle -> IO Word64
- sameError :: FsError -> FsError -> Bool
Documentation
truncate :: FHandle -> Word64 -> IO () Source #
Truncates the file managed by the input FHandle to the input size.
seek :: FHandle -> SeekMode -> Int64 -> IO () Source #
Seek within the file.
The offset may be negative.
We don't return the new offset since the behaviour of lseek is rather odd (e.g., the file pointer may not actually be moved until a subsequent write)
read :: FHandle -> Word64 -> IO ByteString Source #
Reads a given number of bytes from the input FHandle.
write :: FHandle -> Ptr Word8 -> Int64 -> IO Word32 Source #
Writes the data pointed by the input 'Ptr Word8' into the input FHandle.