public Method

File.ctime

file.ctime  time

Returns the change time for file (that is, the time directory information about the file was changed, not the file itself).

File.new("testfile").ctime   #=> Wed Apr 09 08:53:14 CDT 2003

Source Code

/*
*  call-seq:
*     file.ctime -> time
*  
*  Returns the change time for <i>file</i> (that is, the time directory
*  information about the file was changed, not the file itself).
*     
*     File.new("testfile").ctime   #=> Wed Apr 09 08:53:14 CDT 2003
*     
*/

static VALUE
rb_file_ctime(obj)
   VALUE obj;
{
   OpenFile *fptr;
   struct stat st;

   GetOpenFile(obj, fptr);
   if (fstat(fileno(fptr->f), &st) == -1) {
       rb_sys_fail(fptr->path);
   }
   return rb_time_new(st.st_ctime, 0);
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.