Skip to content

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

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.
See also #birthtime #blockdev? #atime #blocks also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0