-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Write output to disk atomically -- -- This package implements utilities to perform atomic output so as to -- avoid the problem of partial intermediate files. @package safeio @version 0.0.2.0 module System.IO.SafeWrite -- | Variation of withFile for output files. -- -- Output is written to a temporary file. Once the action has completed, -- this file is then sync'ed to disk (see |syncFile|) and renamed to its -- final destination. In Posix, this is an atomic operation. If an -- exception is raised, then the temporary output file will be deleted -- and not saved to disk. Thus, the result file will either contain the -- complete result or will be empty. withOutputFile :: FilePath -> (Handle -> IO a) -> IO a -- | Sync a file to disk -- -- Only supported on Posix (patches with Windows support are welcome) syncFile :: FilePath -> IO () module Data.Conduit.SafeWrite -- | Write to file |finalname| using a temporary file and atomic move. -- -- The file is only written if the sink runs to completion without -- errors. Any form of early termination will cause the output to be -- removed. safeSinkFile :: (MonadResource m) => FilePath -> Sink ByteString m ()