Method: ArTTY::SystemInfo#fs_usage

Defined in:
lib/arTTY/system_info.rb

#fs_usage(fs = "/") ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/arTTY/system_info.rb', line 25

def fs_usage(fs = "/")
    return "" if (ScoobyDoo.where_are_you("df").nil?)

    df = %x(df -h #{fs} | tail -n 1)
    df.match(/^\S+\s+(\S+)\s+(\S+)\s+\S+\s+(\S+)/) do |m|
        return "#{m[2]} / #{m[1]} (#{m[3]})".strip
    end

    return ""
end