How to obtain available disk space in Ruby

2024-09-10 ruby
gem install sys-filesystem
require 'sys/filesystem'

stat = Sys::Filesystem.stat("/")
mb_available = stat.block_size * stat.blocks_available / 1024 / 1024

URL: