appendFile package:system-fileio

Append a ByteString to a file. If the file does not exist, it will be created. This computation throws IOError on failure. See “Classifying I/O errors” in the System.IO.Error documentation for information on why the failure occured.