write a new file instead of renaming so that it works across filesystems better