Stephen Gran on 24 Jan 2007 00:45:18 -0000


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

Re: [PLUG] ctime


On Tue, Jan 23, 2007 at 01:07:56PM -0500, gyoza@comcast.net said:
> OK, I see that it isn't quick and easy.  heh
> 
> We are looking to change the creation time.  From what I understand, 
> ctime is the closest thing to creation time.

Just a side note: 'ctime' in my mind always means seconds since the epoch.
I find other useages confusing, so maybe remembering to clarify in the
future would be helpful for dunces like me.

There are 3 times associated with a file: status change, modification,
and access.  As others have noted, changing status change time without
extraordinary measures is interesting.  Changing modification times
or access times is trivial (this is how touch works, for instance).
This simple perl script will do it:

#!/usr/bin/perl
my $atime = my $mtime = time;
utime $atime, $mtime, @ARGV;

But I suspect that's not what you're looking for.
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | Emotions are alien to me.  I'm a        |
|  steve@lobefin.net             | scientist.   -- Spock, "This Side of    |
|  http://www.lobefin.net/~steve | Paradise", stardate 3417.3              |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug