On Thu, 17 Aug 2006, Chad P. wrote:
That is, effectively, creation time (for a particular definition of file
creation). It returns the time at which the file’s listing in the
information for the enclosing directory changed, which basically means when
it was created within that directory. Same difference. I do think the
letter C stands for “change” in this case, though, not only in Ruby docs,
but in POSIX standards as well.
man 2 stat
…
The field st_ctime is changed by writing or by setting inode
informa-
tion (i.e., owner, group, link count, mode, etc.).
…
it’s change time and this isn’t even really close to creation time for
any
definition since operations like chmod, chowner, chgrp or linking to the
file
all effect this timestamp. for example
harp:~ > touch foobar
harp:~ > stat foobar
File: `foobar'
Size: 4096 Blocks: 8 IO Block: 4096
Directory
Device: 306h/774d Inode: 278848 Links: 2
Access: (0775/drwxrwxr-x) Uid: ( 447/ ahoward) Gid: ( 447/
ahoward)
Access: 2006-08-16 15:49:58.000000000 -0600
Modify: 2006-08-16 15:49:58.000000000 -0600
Change: 2006-08-16 15:49:58.000000000 -0600
harp:~ > ln -s foobar barfoo
harp:~ > stat foobar
File: `foobar'
Size: 4096 Blocks: 8 IO Block: 4096
Directory
Device: 306h/774d Inode: 278848 Links: 2
Access: (0775/drwxrwxr-x) Uid: ( 447/ ahoward) Gid: ( 447/
ahoward)
Access: 2006-08-16 15:49:58.000000000 -0600
Modify: 2006-08-16 15:50:20.000000000 -0600
Change: 2006-08-16 15:50:20.000000000 -0600
i can’t even begin to tell you how many legacy perl scripts i’ve found
with
this logic error in them - it’s a really hard one to track down.
in any case it’s a simple thing to read about so i’m not sure why it
causes so
much confusion… there simply is no concept of file creation time in
unix.
btw. my dirwatch directory event code works around this to a large
degree for
certain situations.
regards.
-a