End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
File::Stat#blksize
stat.blksize → integer or nil
file.c
View on GitHub ↗
static VALUE
rb_stat_blksize(VALUE self)
{
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
return ULONG2NUM(get_stat(self)->st_blksize);
#else
return Qnil;
#endif
}
Returns the native file system’s block size. Will return nil on platforms that don’t support this information.
Example
File.stat("testfile").blksize #=> 4096