static public Method

File.ctime(p1)

File.ctime(file_name)   time

Returns the change time for the named file (the time at which directory information about the file was changed, not the file itself).

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

Source Code

/*
*  call-seq:
*     File.ctime(file_name)  => time
*  
*  Returns the change time for the named file (the time at which
*  directory information about the file was changed, not the file
*  itself).
*     
*     File.ctime("testfile")   #=> Wed Apr 09 08:53:13 CDT 2003
*     
*/

static VALUE
rb_file_s_ctime(klass, fname)
   VALUE klass, fname;
{
   struct stat st;

   if (rb_stat(fname, &st) < 0)
       rb_sys_fail(RSTRING(fname)->ptr);
   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.