[email protected] (Riccardo Mottola) writes:
>I can with lstat get it and on copy of a file, set it using by using
>utime(3) or utimensat(3)
>But can I set the creation time? I'd like to be able to preserve it when
>dealing with files.
This is explained in the utimes manpage. utimensat() will set the
birth time when the modification time predates the current birth time.
So you cannot set a future date. But e.g. creating a file, setting
modification time to birth time, then in a second call setting the
modification time to the real modification time, will do what you
want.
To set a later birth time you need to travel into the future
(e.g. by manipulating the system clock) and be careful to avoid
paradoxes when you dare to come back.
--
--
Michael van Elst
Internet: [email protected]
"A potential Snark may lurk in every tree."