[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

cross platform method to obtain disk usage

Tim Ferrell

2/4/2005 4:26:00 PM

I am working on something where one of the requirements is to manage
disk usage (kind of a rotating backup thing) and I was wondering if
anyone could point me in the right direction for determining disk usage
from Ruby.

I have been tinkering with using syscall (I am on Linux) but ultimately
I'd like to find a way to do this on Windows as well... Any thoughts? I
am not against using C if necessary, but perhaps that can be avoided? :-)

Cheers,
Tim


7 Answers

Dick Davies

2/4/2005 4:42:00 PM

0

* Tim Ferrell <Tim.Ferrell@mcgeecorp.com> [0226 16:26]:
> I am working on something where one of the requirements is to manage
> disk usage (kind of a rotating backup thing) and I was wondering if
> anyone could point me in the right direction for determining disk usage
> from Ruby.
>
> I have been tinkering with using syscall (I am on Linux) but ultimately
> I'd like to find a way to do this on Windows as well... Any thoughts? I
> am not against using C if necessary, but perhaps that can be avoided? :-)


How cross-platform? I'd do it with snmp myself, but you might need to tweak
the clients....

--
'What have you done to the cat? It looks half-dead.'
-- Schroedinger's wife
Rasputin :: Jack of All Trades - Master of Nuns


Robert Klemme

2/4/2005 4:45:00 PM

0


"Tim Ferrell" <Tim.Ferrell@mcgeecorp.com> schrieb im Newsbeitrag
news:4203A207.7040102@mcgeecorp.com...
> I am working on something where one of the requirements is to manage
> disk usage (kind of a rotating backup thing) and I was wondering if
> anyone could point me in the right direction for determining disk usage
> from Ruby.
>
> I have been tinkering with using syscall (I am on Linux) but ultimately
> I'd like to find a way to do this on Windows as well... Any thoughts? I
> am not against using C if necessary, but perhaps that can be avoided?
:-)

Hm, probably this is helpful:
http://raa.ruby-lang.org/project/f...

Kind regards

robert

Caio Tiago Oliveira

2/4/2005 5:08:00 PM

0

Robert Klemme, 4/2/2005 13:50:
> "Tim Ferrell" <Tim.Ferrell@mcgeecorp.com> schrieb im Newsbeitrag
> news:4203A207.7040102@mcgeecorp.com...
>> I am working on something where one of the requirements is to manage
>> disk usage (kind of a rotating backup thing) and I was wondering if
>> anyone could point me in the right direction for determining disk usage
>> from Ruby.
>>
>> I have been tinkering with using syscall (I am on Linux) but ultimately
>> I'd like to find a way to do this on Windows as well... Any thoughts? I
>> am not against using C if necessary, but perhaps that can be avoided?
> :-)
>
> Hm, probably this is helpful:
> http://raa.ruby-lang.org/project/f...

The page says: "Tested on Linux and Solaris.".
I don't think it works on windows.

"'statvfs' and 'getmntent'"...



Robert McGovern

2/4/2005 5:17:00 PM

0

On Sat, 5 Feb 2005 01:25:59 +0900, Tim Ferrell
<Tim.Ferrell@mcgeecorp.com> wrote:
> I am working on something where one of the requirements is to manage
> disk usage (kind of a rotating backup thing) and I was wondering if
> anyone could point me in the right direction for determining disk usage
> from Ruby.

Don't know, I do know that there has been an open bug / request for
enhancement in Java for this for the last 7 years. The current target
is JDK1.6, maybe 2 years away :(

So if there was a way in Ruby, it would be another good reason for
Java people to join the Ruby party ;)

Rob


djberg96

2/4/2005 5:28:00 PM

0

Caio Tiago Oliveira wrote:
> Robert Klemme, 4/2/2005 13:50:
> > "Tim Ferrell" <Tim.Ferrell@mcgeecorp.com> schrieb im Newsbeitrag
> > news:4203A207.7040102@mcgeecorp.com...
> >> I am working on something where one of the requirements is to
manage
> >> disk usage (kind of a rotating backup thing) and I was wondering
if
> >> anyone could point me in the right direction for determining disk
usage
> >> from Ruby.
> >>
> >> I have been tinkering with using syscall (I am on Linux) but
ultimately
> >> I'd like to find a way to do this on Windows as well... Any
thoughts? I
> >> am not against using C if necessary, but perhaps that can be
avoided?
> > :-)
> >
> > Hm, probably this is helpful:
> > http://raa.ruby-lang.org/project/f...
>
> The page says: "Tested on Linux and Solaris.".
> I don't think it works on windows.
>
> "'statvfs' and 'getmntent'"...

I've tested it on FreeBSD and HP-UX as well.

No, it doesn't work on Windows. I've been mulling over a
win32-filesystem package for win32utils, but I don't know that it's
realistic to keep a unified API between *nix and Win32. But, I'll mull
it over.

Regards,

Dan

Zach Dennis

2/4/2005 6:33:00 PM

0

Daniel Berger wrote:

> I've tested it on FreeBSD and HP-UX as well.
>
> No, it doesn't work on Windows. I've been mulling over a
> win32-filesystem package for win32utils, but I don't know that it's
> realistic to keep a unified API between *nix and Win32. But, I'll mull
> it over.

I'd think their should be a unified API in the ruby library for getting
this information, rather then have two separate methods in potentially
two separate packages for accessing this information long term depending
on whether you're on a *nix or windows machine. Let's make this easier
on the developer, thus making ruby more attractive for developers from
other languages.

Short term if a method is added to the win32utils then I would think
that is good to have, but ultimately consistency and transparency to the
user (developer) would be the ultimate goal. IMO

Zach


Robert Klemme

2/4/2005 6:55:00 PM

0


"Zach Dennis" <zdennis@mktec.com> schrieb im Newsbeitrag
news:4203BFCA.4060806@mktec.com...
> Daniel Berger wrote:
>
>> I've tested it on FreeBSD and HP-UX as well.
>>
>> No, it doesn't work on Windows. I've been mulling over a
>> win32-filesystem package for win32utils, but I don't know that it's
>> realistic to keep a unified API between *nix and Win32. But, I'll mull
>> it over.
>
> I'd think their should be a unified API in the ruby library for getting
> this information, rather then have two separate methods in potentially two
> separate packages for accessing this information long term depending on
> whether you're on a *nix or windows machine. Let's make this easier on the
> developer, thus making ruby more attractive for developers from other
> languages.
>
> Short term if a method is added to the win32utils then I would think that
> is good to have, but ultimately consistency and transparency to the user
> (developer) would be the ultimate goal. IMO

Definitely! +1 from here

Kind regards

robert