Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
File::Stat.new
new(p1)
file.c
View on GitHub ↗
static VALUE
rb_stat_init(VALUE obj, VALUE fname)
{
struct stat st;
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (STAT(StringValueCStr(fname), &st) == -1) {
rb_sys_fail_path(fname);
}
struct rb_stat *rb_st;
TypedData_Get_Struct(obj, struct rb_stat, &stat_data_type, rb_st);
rb_st->stat = st;
rb_st->initialized = true;
return Qnil;
}
File::Stat.new(file_name) -> stat
Create a File::Stat object for the given file name (raising an exception if the file doesn’t exist).