in reply to How do you modify the creation date of a folder?

Because the creation date is... er... the date the file was created (hence the name!)

You can modify or access the file, so changing the mtime or atime makes sense, but you can't create the file again, so changing the ctime isn't possible.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you don't talk about Perl club."

  • Comment on Re: How do you modify the creation date of a folder?

Replies are listed 'Best First'.
Re: Re: How do you modify the creation date of a folder?
by ruffing (Acolyte) on Oct 03, 2001 at 19:51 UTC
    What happened was through copying a disk drive to another drive, the folders it created on the new drive to house the info from the other drive had an updated creation time. I'm looking to try to match the original time on the old drive with the time on the new drive. But if I can't modify the date of the new folders, I'll have to come up with an alternative solution. The reason being is that our perl scripts depend on the creation time of folders in a certain directory. Thanks for your help anyways. Scott
      The correct solution seems to be to change the perl scripts to not reily (solely) on the ctime of the folders, not to change the ctime of the folders.
      Thanks,
      James Mastros,
      Just Another Perl Initate
Re: Re: How do you modify the creation date of a folder?
by trantor (Chaplain) on Oct 04, 2001 at 14:48 UTC

    ctime, in standard UNIX semantics, is not the creation time of the file. It is a timestamp updated whenever the file or directory's inode is updated (e.g. with chmod or chown, or when utime(2) is called on the file itself). It can be thought as a "change time" but definitely it is not the "creation time".

    As far as I know it cannot be altered without low level editing of the partition where the inode resides.

    So, ruffing, you're out of luck twice: once because ctime cannot be altered, twice because it is not the creation time. This also means that it's probably a good idea to follow theorbtwo's suggestion and change your Perl scripts: you're not relying on the creation time of the inode, but rather on the time it was last updated, which can be totally different.

    -- TMTOWTDI