Copy file metadata in atomic save

Closes gh-6405