cautious-file-1.0.1: Ways to write a file cautiously, to reduce the chances of problems such as data loss due to crashes or power failures

Safe HaskellSafe-Infered

System.IO.Cautious

Description

It is recommended to write

import Prelude hiding (writeFile)

when importing this module.

Synopsis

Documentation

writeFileWithBackup :: IO () -> FilePath -> String -> IO ()Source

Backs up the old version of the file with backup. backup must not fail if there is no old version of the file.

writeFileWithBackupL :: IO () -> FilePath -> ByteString -> IO ()Source

Backs up the old version of the file with backup. backup must not fail if there is no old version of the file.