From: gwtmp01@... Date: 2006-11-15T00:14:52+09:00 Subject: Re: What's up with File.ctime? On Nov 14, 2006, at 9:50 AM, Jan Svitok wrote: > On 11/14/06, Peter Bailey wrote: >> Thanks, Jan. Actually, I figured it out for myself. Looking deeper >> into >> it, I found File.stat.mtime, and that's I'm using now, and it works. >> .ctime, I guess, stands for "change time," so, it doesn't actually >> state >> the timestamp of the file as it is. Thanks again. > > Well, I thought ctime = creation time ;-) Now I've learned > something as well. Just to make things a little clearer: the 'change' referenced by 'ctime' is a change to the inode (or metadata) for the file. So for example if the ownership or permissions of a file change then ctime will be updated. If the length of a file is changed (i.e. data is appended to the file) then ctime will change. The mtime field on the other hand only changes when data is written to the file (either new data appended to the end or existing data is modified). Lots of people think ctime = 'creation time' but the Posix API doesn't actually provide access to a 'create time'. I believe some Windows and Mac OS filesystems do have a notion of 'create time' that is recorded separately from the Posix 'ctime'. I don't know what the APIs are to access that timestamp on those platforms. Gary Wright