Mailinglist Archive: opensuse (3337 mails)

< Previous Next >
When is ctime changed (was: cron not recognizing changes to /etc/cron.d files)
  • From: Joachim Schrod <jschrod@xxxxxxx>
  • Date: Mon, 10 Apr 2006 12:30:49 +0200
  • Message-id: <443A33D9.5030709@xxxxxxx>
Greg Wallace wrote:
On Sunday, April 09, 2006 @ 2:50 PM, Joachim Schrod wrote:

By the way, the full formal definition of ctime is buried in the pit of the
Single Unix Specification; where every function that changes the ctime value says so explicitly in its description.

I promise I'm not trying to steal this thread,

Subject changing is a good idea then. ;-)

What type of action changes the file's status
change date (and would that also necessarily change the file's
creation/modification date?)?

Everything that changes the file name or its content updates ctime, also mtime.
One can set the mtime explicitly with utime() or utimes(), but not the ctime.
In fact, utime() updates ctime itself. This means that ctime is the more reliable indicator when a file was changed the last time in any way than mtime. For example, if you unpack a tar or zip archive, or if you install an RPM, the files' mtime will get set as specified in the archive, but the ctimes are set to the timestamp of unpacking.

For the precise information I posted the link above.
Click on "Word" search, and search for "st_ctime" in the XSH section. Then all C functions appear that (may) update ctime.


Joachim Schrod Email: jschrod@xxxxxxx
Roedermark, Germany

< Previous Next >