From: Jan Svitok Date: 2006-11-14T23:50:08+09:00 Subject: Re: What's up with File.ctime? On 11/14/06, Peter Bailey wrote: > Jan Svitok wrote: > > On 11/14/06, Peter Bailey wrote: > >> Hello, > >> I need to notate the date/time attributes of files. I'm using File.ctime > >> and trimming it back to show just day, date, and time. > >> > >> filetime = File.ctime(txtfile) > >> filetime = filetime.to_s.gsub!(/ -.*$/, "") > >> > >> But, I've noticed that files that list in the directories as being dated > >> November 8 are showing via ctime as November 13 files. What's up? > > > > Perhaps dir/ls shows mtime? Try checking mtime/ctime/atime to see > > which is the right one. > > To display ctime on windows, try dir /T:C on unix ls -l --time=ctime > > 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.