static public Method

File.atime(p1)

File.atime(file_name)    time

Returns the last access time for the named file as a Time object).

File.atime("testfile")   #=> Wed Apr 09 08:51:48 CDT 2003

Source Code

/*
*  call-seq:
*     File.atime(file_name)  =>  time
*  
*  Returns the last access time for the named file as a Time object).
*     
*     File.atime("testfile")   #=> Wed Apr 09 08:51:48 CDT 2003
*     
*/

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

   if (rb_stat(fname, &st) < 0)
       rb_sys_fail(StringValueCStr(fname));
   return rb_time_new(st.st_atime, 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.