Method: File.stat

Defined in:
file.c

.stat(file_name) ⇒ Object

Returns a File::Stat object for the named file (see File::Stat).

File.stat("testfile").mtime   #=> Tue Apr 08 12:58:04 CDT 2003


982
983
984
985
986
987
988
989
990
991
992
# File 'file.c', line 982

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

    FilePathValue(fname);
    if (rb_stat(fname, &st) < 0) {
	rb_sys_fail_path(fname);
    }
    return rb_stat_new(&st);
}