add note regarding usage of System.IO
commit807ec5c67f4897a48590c0c763874c16e13d459a
authorAgentM <agentm@themactionfaction.com>
dateMon 30 Oct 2017, 00:26 (9 years ago)
parenta2b0224
src/lib/ProjectM36/Persist.hs+1
@@ -31,6 +31,7 @@ foreign import ccall unsafe "cDirectoryFsync" cHSDirectoryFsync :: CString -> IO
3131
3232data DiskSync = NoDiskSync | FsyncDiskSync
3333
34+--using withFile here is OK because we use a WORM strategy- the file is written but not read until after the handle is synced, closed, and unhidden (moved from ".X" to "X") at the top level in the transaction directory
3435writeFileSync :: DiskSync -> FilePath -> Text -> IO()
3536writeFileSync sync path strOut = withFile path WriteMode handler
3637 where