Preserving target file's creation date

Arthur Chance freebsd at qeng-ho.org
Tue Sep 29 11:07:15 UTC 2020


On 29/09/2020 11:42, Jerry wrote:
> I am trying to copy/move one file onto another. I need to preserve the
> creation date of the target file. I see options to preserve the
> creation date of the source file, but not the target file. Is it
> possible?

I think the creation time of a file is immutable, but if you were to
truncate the file and then append to it, it should retain the original
creation time while getting the contents of the source file.

truncate -s 0 $file
cat $otherfile >> $file

-- 
The number of people predicting the demise of Moore's Law doubles
every 18 months.


More information about the freebsd-questions mailing list