LambdaHack-0.2.10: A roguelike game engine in early and active development

Safe HaskellNone

Game.LambdaHack.Utils.File

Description

Saving/loading with serialization and compression.

Synopsis

Documentation

encodeEOF :: Binary a => FilePath -> a -> IO ()

Serialize, compress and save data with an EOF marker. The OK is used as an EOF marker to ensure any apparent problems with corrupted files are reported to the user ASAP.

strictDecodeEOF :: Binary a => FilePath -> IO a

Read, decompress and deserialize data with an EOF marker. The OK EOF marker ensures any easily detectable file corruption is discovered and reported before the function returns.

tryCreateDir :: FilePath -> IO ()

Try to create a directory, if it doesn't exist. Terminate the program with an exception if the directory does not exist, but can't be created.

tryCopyDataFiles :: (FilePath -> IO FilePath) -> [(FilePath, FilePath)] -> IO ()

Try to copy over data files, if not already there.