rio-0.1.22.0: A standard library for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

RIO.File

Description

Rationale

This module offers functions to handle files that offer better durability and/or atomicity.

See UnliftIO.IO.File for the rationale behind this module, since all of the functions were moved upstream and are now simply re-exported from here.

Since: 0.1.6

Synopsis

Regular

withBinaryFile :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m a) -> m a #

writeBinaryFile :: MonadIO m => FilePath -> ByteString -> m () #

Atomic

withBinaryFileAtomic :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r #

writeBinaryFileAtomic :: MonadIO m => FilePath -> ByteString -> m () #

Durable

withBinaryFileDurable :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r #

writeBinaryFileDurable :: MonadIO m => FilePath -> ByteString -> m () #

ensureFileDurable :: MonadIO m => FilePath -> m () #

Durable and Atomic

withBinaryFileDurableAtomic :: MonadUnliftIO m => FilePath -> IOMode -> (Handle -> m r) -> m r #