wxTempFFile provides a relatively safe way to replace the contents of the existing file.
wxFFile implements buffered file I/O.