NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: setting file creation time of a date



Hi,

Johnny Billquist wrote:
Looking at the utimes system call, you can potentially modify the birthtime through that. But only indirectly, and in one direction.

If you set modification time to something older than birthtime, birthtime will be changed to modification time.

Supposing I create a file and then want to set the attributes of the original one, that I have to call utime twice: first with the creation date (which will set actually create+modification date( and then with the modification date which, being newer, will change it.

This works fine in normal circumstances in case the two dates are sequential as one expect.

if you have "strange" files, like I have seen on windows where creation is later than modification, it will not preserve them. Of course this is a broken situation, happens with unzipped files, files copied over a network share... I don't know...

It can't preserve brokenness, but at least it could avoid creating it :-P


Riccardo


Home | Main Index | Thread Index | Old Index