writeSyncState :: FilePath -> SyncState -> IO ()
writeSyncState syncFile state = do
    let tempFile = syncFile ++ ".tmp"
    writeFile tempFile (show state)
    renameFile tempFile syncFile
writeSyncState :: FilePath -> SyncState -> IO ()
writeSyncState syncFile state = do
    let tempFile = syncFile ++ ".tmp"
    writeFile tempFile (show state)
    renameFile tempFile syncFile
writeSyncState syncFile state = do
    let tempFile = syncFile ++ ".tmp"
    writeFile tempFile (show state)
    renameFile tempFile syncFile