Ruby 4.0 リファレンスマニュアル

instance method File::Stat#blocks

blocks -> Integer[permalink][rdoc][edit]
() → Integer?

割り当てられているブロック数を返します。

fs = File::Stat.new($0)
#例
p fs.blocks  # => nil