mtime(p1)
public
Returns the modification time for the named file as a Time object.
File.mtime("testfile")
Show source
/*
* call-seq:
* File.mtime(file_name) => time
*
* Returns the modification time for the named file as a Time object.
*
* File.mtime("testfile") #=> Tue Apr 08 12:58:04 CDT 2003
*
*/
static VALUE
rb_file_s_mtime(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_mtime, 0);
}