change ctime [creation time] of a file to any time?

change ctime [creation time] of a file to any time?

Post by Michael Wa » Sun, 08 Feb 1998 04:00:00




Quote:

>Under my copy of Linux (2.0.33) and a Solaris 2.5 system that I have
>access to, touch DOES update the ctime.

I check both Solaris touch and GNU touch, none of them update ctime.
The following is GNU touch usage:

     touch [-acfm] [-r file] [-t MMDDhhmm[[CC]YY][.ss]] [-d time]
     [ - -time={atime,access,use,mtime,modify}] [--date=time] [--
     reference=file] [--no-create] [--help] [--version] file...

ctime is not there. I assume that you can not change ctime to any
time.

You can change system time and then use chmod, but that is not acceptable.

 
 
 

change ctime [creation time] of a file to any time?

Post by Douglas McNaugh » Sun, 08 Feb 1998 04:00:00




> >Under my copy of Linux (2.0.33) and a Solaris 2.5 system that I have
> >access to, touch DOES update the ctime.

> I check both Solaris touch and GNU touch, none of them update ctime.
> The following is GNU touch usage:
> You can change system time and then use chmod, but that is not acceptable.

Just a note for those who are misled by the Subject: line: ctime is
*not* the creation time of the file.  It's the "inode change" time,
updated by the system when the information in the file's inode
(permissions, ownership etc) is modified.  As you note, it can't be
changed by the user.  Why would you want to?

-Doug
--
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";