ouroboros-consensus-0.1.0.1: Consensus layer for the Ouroboros blockchain protocol
Safe Haskell Safe-Inferred
Language Haskell2010

Ouroboros.Consensus.Storage.FS.Handle

Description

This is meant to be used for the implementation of HasFS instances and not directly by client code.

Synopsis

Documentation

data HandleOS osHandle Source #

File handlers for the IO instance for HasFS. This is parametric on the os.

The FilePath is used to improve error messages. The MVar is used to implement close . osHandle is Fd for unix and HANDLE for Windows.

closeHandleOS :: HandleOS osHandle -> (osHandle -> IO ()) -> IO () Source #

This is a no-op when the handle is already closed.

withOpenHandle :: String -> HandleOS osHandle -> (osHandle -> IO a) -> IO a Source #

This is meant to be used for the implementation of individual file system commands. Using it for larger scopes woud not be correct, since we would not notice if the handle is closed.