[TUHS] When/how did ctime change from inode "creation" to "change" time?

Marc Rochkind mrochkind at gmail.com
Thu Mar 13 03:58:09 AEST 2025


According to my 1985 book *Advanced UNIX Programming*, the st_ctime member
is "the status-change time, updated when the file is written or when the
mode, owner, group, link count, or modification time is changed. Updated
when the access time is changed explicitly via utime, but not when the file
is read." I don't ever remember st_ctime being the creation time.

I probably got that information from whatever UNIX manuals I was reading at
the time.

Marc

On Tue, Mar 11, 2025 at 8:57 PM Theodore Ts'o <tytso at mit.edu> wrote:

> As part of a discusion on the Linux kernel mailing list, there was an
> assertion that ctime was orginally "creation time".
>
> From the v7 sources in TUHS, we can see:
>
> struct dinode
> {
>         unsigned short  di_mode;        /* mode and type of file */
>         short   di_nlink;       /* number of links to file */
>         short   di_uid;         /* owner's user id */
>         short   di_gid;         /* owner's group id */
>         off_t   di_size;        /* number of bytes in file */
>         char    di_addr[40];    /* disk block addresses */
>         time_t  di_atime;       /* time last accessed */
>         time_t  di_mtime;       /* time last modified */
>         time_t  di_ctime;       /* time created */
> };
>
> ... although the v7 kernel sources does seem to update ctime when the
> inode metadata changes, regardless of what the coment in
> /usr/src/sys/h/ino.h might say.
>
> More interestingly, this comment seems to continue in newer versions
> up to 3BSD, and then the comments becomes "change time" in BSD 4.2,
> probably coincident with the File System Implementation?
>
> The best we can guess is that the change from "creation time" to
> "inode change time" happened sometime between 1979 and 1982.  Does
> anyone who was around can give the story about how and when this
> happened?
>
>                                         - Ted
>


-- 
Subscribe to my Photo-of-the-Week emails at my website mrochkind.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20250312/4b96be2d/attachment.htm>


More information about the TUHS mailing list