From: "Brian F. Feldman" Date: 2001-11-11T02:15:53+09:00 Subject: [ruby-talk:24836] Re: Looking for df interface mjbjr@beaudesign.com wrote: > On Sat, Nov 10, 2001 at 01:08:01AM +0900, Daniel Berger wrote: > > Hi all, > > > > I'm really just looking for an OO interface to the unix 'df' command. > > I looked at File::Stat but it didn't appear to have the functionality > > I needed to emulate DF. > > Well, this might not help all that much... > > You can get the raw data from '/proc/partitions', returned as lines of strings. > > I see you've already used File::Stat, but for others, all devices are > mapped as files under Linux. Write an implementation for the system calls statfs(2) (File.statfs(path)) and fstatfs(2) (File#statfs()). You'll want to also create a new File::Statfs class that will return the struct statfs {}. It would be quite easy :) -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------'