The easiest way for the computer to save a file is to simply over-write it (either that or append to it, though this could lead to rather large files).

You can check if a file exists before-hand...