instance method
IO#stat
() -> ::File::Stat
ios.stat → stat
file.c
View on GitHub ↗
static VALUE
rb_io_stat(VALUE obj)
{
rb_io_t *fptr;
rb_io_stat_data st;
GetOpenFile(obj, fptr);
if (fstatx_without_gvl(fptr, &st, STATX_ALL) == -1) {
rb_sys_fail_path(fptr->pathv);
}
return rb_statx_new(&st);
}
Returns status information for ios as an object of type File::Stat.
Example
f = File.new("testfile") s = f.stat "%o" % s.mode #=> "100644" s.blksize #=> 4096 s.atime #=> Wed Apr 09 08:53:54 CDT 2003