This could override a file. The change is consistent with the previous implementation (where data was only appended to the file) so it's okay for me. But the documentation doesn't say anything about that. This could be improved I think.