module Cloudscopes::StatFs

Public Class Methods

statfs(path) click to toggle source

Drives the interface to the C library, returns a StatFs::Result object to show filesystem information for the given path.

# File lib/cloudscopes/filesystem.rb, line 21
def self.statfs(path)
  output = FFI::MemoryPointer.new(128)
  begin
    error_code = Lib::statfs64(path, output)
    raise "statfs raised error #{error_code}" if error_code != 0
    return Result.new(*output[0].read_array_of_long(7))
  ensure
    output.free
  end
end