How exactly does ctime work?

Eric Blake eblake@redhat.com
Tue May 8 23:12:00 GMT 2012


On 05/08/2012 05:06 PM, Joshua Hudson wrote:
> We had a weird incident involving ctime changing unexpectedly when
> mtime did not.
> 
> On a normal UNIX system, we'd immediately say somebody changed the
> file and set mtime back, but on Cygwin, ctime appears to be synthetic.

Not necessarily true.  On a normal UNIX system, it is also possible to
chmod the file, which changes the ctime but not the mtime.

> 
> How exactly does ctime work on Cygwin? I can't find any useful
> documentation except for some mailing list discussions circa 2005 that
> leave me with no answers.

It operates as much like POSIX requires it to as we can make it behave.
 In particular, ctime cannot be faked by the user, and is altered any
time any other piece of file metadata is modified, including via calls
such as chmod.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20120508/ad11dcd4/attachment.sig>


More information about the Cygwin mailing list