Hmm, I understand.
after the original file is deleted and temporary file is renamed to the original file name, you lose all attributes of the original file (such as owner and group) except for basic permissions
Wouldn't it make sense to do the following?
- read attributes before deleting the file
- set the attributes to the temporary file (warn if this does not work)
- rename the temporary file to the original file name
A warning message would also be very helpful if attributes such as owner and group cannot be transferred, because a production system can become faulty due to incorrect attributes.
What do you think?