adding TempFile
replace_or_add seems to be behaving
preserving file owner and permissions in replace_or_add