wxTempFile provides a relatively safe way to replace the contents of the existing file.
A wxFile performs raw file I/O.