cross platform method to obtain disk usage

Discussion in 'Ruby' started by Tim Ferrell, Feb 4, 2005.

  1. Tim Ferrell

    Tim Ferrell Guest

    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
     
    Tim Ferrell, Feb 4, 2005
    #1
    1. Advertising

  2. Tim Ferrell

    Dick Davies Guest

    * Tim Ferrell <> [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
     
    Dick Davies, Feb 4, 2005
    #2
    1. Advertising

  3. "Tim Ferrell" <> schrieb im Newsbeitrag
    news:...
    > 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/filesystem/

    Kind regards

    robert
     
    Robert Klemme, Feb 4, 2005
    #3
  4. Robert Klemme, 4/2/2005 13:50:
    > "Tim Ferrell" <> schrieb im Newsbeitrag
    > news:...
    >> 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/filesystem/


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

    "'statvfs' and 'getmntent'"...
     
    Caio Tiago Oliveira, Feb 4, 2005
    #4
  5. On Sat, 5 Feb 2005 01:25:59 +0900, Tim Ferrell
    <> 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
     
    Robert McGovern, Feb 4, 2005
    #5
  6. Caio Tiago Oliveira wrote:
    > Robert Klemme, 4/2/2005 13:50:
    > > "Tim Ferrell" <> schrieb im Newsbeitrag
    > > news:...
    > >> 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/filesystem/

    >
    > 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
     
    Daniel Berger, Feb 4, 2005
    #6
  7. Tim Ferrell

    Zach Dennis Guest

    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
     
    Zach Dennis, Feb 4, 2005
    #7
  8. "Zach Dennis" <> schrieb im Newsbeitrag
    news:...
    > 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
     
    Robert Klemme, Feb 4, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jas Shultz
    Replies:
    0
    Views:
    966
    Jas Shultz
    Dec 3, 2003
  2. Alex Martelli
    Replies:
    25
    Views:
    1,478
    MrJean1
    Dec 1, 2005
  3. Replies:
    12
    Views:
    529
    santosh
    Nov 15, 2006
  4. it_says_BALLS_on_your_forehead
    Replies:
    3
    Views:
    102
    it_says_BALLS_on_your_forehead
    Nov 10, 2006
  5. Ilias Lazaridis
    Replies:
    7
    Views:
    152
    Ilias Lazaridis
    Jun 16, 2007
Loading...

Share This Page