Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
File::Stat#blksize
() -> ::Integer?
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 block size of the filesystem of the snapshot in self, or nil on Windows:
Example
File.stat('/etc').blksize # => 4096 File.stat('/etc/passwd').blksize # => 4096 File.stat('nosuch').blksize # Raises Errno::ENOENT: No such file or directory.