[go: up one dir, main page]

|
|
Log in / Subscribe / Register

File creation times

File creation times

Posted Jul 29, 2010 23:45 UTC (Thu) by jzbiciak (guest, #5246)
In reply to: File creation times by docwhat
Parent article: File creation times

So how come ctime did *not* change? The metadata (ie. mtime) changed. I'm willing to believe that mtime is *not* in the set of metadata that ctime represents.


to post comments

File creation times

Posted Jul 30, 2010 0:13 UTC (Fri) by docwhat (guest, #40373) [Link] (1 responses)

It happened too fast. I'm using a script. Here it is with a sleep.
$ mkdir -p /tmp/tmp.RZFIqs7625
$ touch /tmp/tmp.RZFIqs7625/somefile
$ stat /tmp/tmp.RZFIqs7625/somefile
  File: `/tmp/tmp.RZFIqs7625/somefile'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: ca02h/51714d    Inode: 1622396     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1002/ docwhat)   Gid: ( 1002/ docwhat)
Access: 2010-07-29 19:50:55.000000000 -0400
Modify: 2010-07-29 19:50:55.000000000 -0400
Change: 2010-07-29 19:50:55.000000000 -0400
$ sleep 2
$ touch -m -d 2110-01-01 /tmp/tmp.RZFIqs7625/somefile
$ stat /tmp/tmp.RZFIqs7625/somefile
  File: `/tmp/tmp.RZFIqs7625/somefile'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: ca02h/51714d    Inode: 1622396     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1002/ docwhat)   Gid: ( 1002/ docwhat)
Access: 2010-07-29 19:50:55.000000000 -0400
Modify: 2110-01-01 00:00:00.000000000 -0500
Change: 2010-07-29 19:50:57.000000000 -0400
The script I used:
#!/bin/bash

set -x

mkdir -p /tmp/tmp.e0EkZhvZQR
touch /tmp/tmp.e0EkZhvZQR/somefile
stat /tmp/tmp.e0EkZhvZQR/somefile
sleep 2
touch -m -d 2110-01-01 /tmp/tmp.e0EkZhvZQR/somefile
stat /tmp/tmp.e0EkZhvZQR/somefile
Here's how I ran it:
$ /tmp/foo.sh |& perl -p -e 's@^\+@\$@'
I just cut-and-pasted the middle of the output.

Ciao!

File creation times

Posted Jul 30, 2010 13:49 UTC (Fri) by jzbiciak (guest, #5246) [Link]

Ah, ok. Mystery solved!


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds