mtime()
public
Returns the modification time for file.
File.new("testfile").mtime
Show source
/*
* call-seq:
* file.mtime -> time
*
* Returns the modification time for <i>file</i>.
*
* File.new("testfile").mtime
*
*/
static VALUE
rb_file_mtime(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_mtime, 0);
}