Dave Burt wrote:
>       `df -k #{dir}`[/\n.{20} (\d+)/, 1].to_i

should be
        `df -k #{dir}`[/\n.{20} (\d+)/, 1].to_i * 1024

Cheers,
Dave