Decide how we want to name the output file
Do we want to:
- Renamed the original file
filename.bak
and name the cleaned onefilename
? - Keep the original file named
filename
and name the cleaned onefilename.cleaned
? This is how it's currently done - Remove the original file, and name the cleaned one
filename
?
I'm not a big fan of the third option, because should the cleanup process fail (MAT2 is written in Python, so this might happen), the original file is lost.
The first option might be the best way, but it means that for some formats, we must use a temporary file, because some parsers can't work inplace.