on master help sign in
add note regarding usage of System.IO
807ec5cAgentM
src/lib/ProjectM36/Persist.hs+1
@@ -31,6 +31,7 @@ foreign import ccall unsafe "cDirectoryFsync" cHSDirectoryFsync :: CString -> IO
31
31
32data DiskSync = NoDiskSync | FsyncDiskSync
32data DiskSync = NoDiskSync | FsyncDiskSync
33
33
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
34writeFileSync :: DiskSync -> FilePath -> Text -> IO()
35writeFileSync :: DiskSync -> FilePath -> Text -> IO()
35writeFileSync sync path strOut = withFile path WriteMode handler
36writeFileSync sync path strOut = withFile path WriteMode handler
36 where
37 where