This is a discussion on How to change ctime of file? within the Debian Linux support forums, part of the Debian Linux category; --> I can use "touch" with options like "-a -m -t" to set any time to "mtime" and "atime" of ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 way to set any other time? frankie |
| |||
| 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 > 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 |
| |||
| On 19 Jul 2006 01:22:21 -0700, frankie <franek4always@wp.pl> wrote: > > 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? > Why would you want to change a file's ctime? -- Real Programmers don't eat quiche. They eat Twinkies and Szechwan food. |
| |||
| 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 > 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 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 |
| |||
| On 2 Aug 2006 11:32:16 -0700, frankie <franek4always@wp.pl> wrote: > > 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? > Probably in `date +%s` format. -- Love thy neighbor, tune thy piano. |
| ||||
| 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 > way to set any other time? frankie wrote: > 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? 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.googlegr oups.com news:1137497064.725217.172010@g43g2000cwa.googlegr oups.com |