Linux Debian support - How to change ctime of file?

This is Interesting: Free IT Magazines  
Home > Archive > Linux Debian support > August 2006 > How to change ctime of file?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to change ctime of file?
frankie

2006-07-14, 7:13 am

I can use "touch" with options like "-a -m -t" to set any time to
"mtime" and "atime" of a file, but there is no option how to change
ctime It always points to the time of chage/modify file. Is it any
way to set any other time?

frankie

Bill Marcum

2006-07-14, 1:12 pm

On 14 Jul 2006 02:44:31 -0700, frankie
<franek4always@wp.pl> wrote:
> I can use "touch" with options like "-a -m -t" to set any time to
> "mtime" and "atime" of a file, but there is no option how to change
> ctime It always points to the time of chage/modify file. Is it any
> way to set any other time?
>

Only by changing the system time, and that is usually not a good idea.


--
He who fears the unknown may one day flee from his own backside.
-- Sinbad
frankie

2006-07-19, 7:27 am


Bill Marcum napisal(a):

> Only by changing the system time, and that is usually not a good idea.
>


Is it true? Maybe there are tools for editting inode table?

frankie

Bill Marcum

2006-07-19, 1:21 pm

On 19 Jul 2006 01:22:21 -0700, frankie
<franek4always@wp.pl> wrote:
>
> Bill Marcum napisal(a):
>
>
> Is it true? Maybe there are tools for editting inode table?
>

Why would you want to change a file's ctime?


--
Real Programmers don't eat quiche. They eat Twinkies and Szechwan food.
frankie

2006-07-20, 7:21 am


Bill Marcum napisal(a):
>
> Why would you want to change a file's ctime?
>


Beacuse I am curious if it possible ;)

frankie

Steven Mocking

2006-07-26, 1:15 pm

frankie wrote:
> I can use "touch" with options like "-a -m -t" to set any time to
> "mtime" and "atime" of a file, but there is no option how to change
> ctime It always points to the time of chage/modify file. Is it any
> way to set any other time?


Since ctime is the last time the inode info was changed, you could
change the system date, make a new hardlink, remove it again and change
the date back.

Steven
frankie

2006-08-02, 7:13 pm


frankie napisal(a):
> Is it true? Maybe there are tools for editting inode table?
>


Finally I've found debugfs tools for ext2/3 filesystems. There is
set_inode_field command so I can edit any inode field. But anybody know
in which format I should give the date/time?

frankie

Bill Marcum

2006-08-03, 7:13 am

On 2 Aug 2006 11:32:16 -0700, frankie
<franek4always@wp.pl> wrote:
>
> frankie napisal(a):
>
> Finally I've found debugfs tools for ext2/3 filesystems. There is
> set_inode_field command so I can edit any inode field. But anybody know
> in which format I should give the date/time?
>

Probably in `date +%s` format.


--
Love thy neighbor, tune thy piano.
Michael Paoli

2006-08-13, 1:12 pm

frankie wrote:
> I can use "touch" with options like "-a -m -t" to set any time to
> "mtime" and "atime" of a file, but there is no option how to change
> ctime It always points to the time of chage/modify file. Is it any
> way to set any other time?


frankie wrote:
> frankie napisal(a):
>
> Finally I've found debugfs tools for ext2/3 filesystems. There is
> set_inode_field command so I can edit any inode field. But anybody know
> in which format I should give the date/time?


Generally speaking, the ctime can't be set arbitrarily. It's
effectively the one relatively high-integrity timestamp on files
(since, as you know, mtime and atime are arbitrarily "user"
settable). Of course one can make certain changes to the file, and
that will update the ctime to the current system time. Of course if
one has superuser (root) access, there are ways to bypass this. E.g.
change the system time (generally not recommended - especially moving
the clock back - most stuff doesn't expect time to go backwards, and
it typically will cause some stuff to fail or behave in unexpected
ways), or unmount the filesystem and edit the data on the filesytem
device (one can set the ctime arbitrarily that way ... and/or
introduce arbitrary corruption or other changes to the filesystem).

See also:
news:1147585091.352911.276580@i39g2000cwa.googlegroups.com
news:1137497064.725217.172010@g43g2000cwa.googlegroups.com

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com