check available disk space

Discussion in 'Ruby' started by jim, Sep 16, 2008.

  1. jim

    jim Guest

    Does anyone know how I can write a Ruby script that can check for
    available disk space on the current working directory? I'd like to be
    able to run the script from Windows and Linux.
     
    jim, Sep 16, 2008
    #1
    1. Advertisements

  2. When dealing with file systems, I usually find myself switching on a
    File.exists?
    => "/dev/sda1 110650276 52580520 52449016 51% /"

    This assumes only two filesystem styles (Windows and Linux)
     
    Tod Beardsley, Sep 16, 2008
    #2
    1. Advertisements

  3. gem install sys-filesystem

    Regards,

    Dan
     
    Daniel Berger, Sep 16, 2008
    #3
  4. jim

    Marc Heiler Guest

    Woot, i didn't know about 'dir /-C'

    Shame on my windows-noob head. Ruby is even nice on windows! :)
     
    Marc Heiler, Sep 16, 2008
    #4
  5. jim

    pr0d1r2 Guest

    W dniu wtorek, 16 września 2008 18:23:18 UTC+2 użytkownik jim napisał:
    Hi. I have created gem specifically for checking free disk space:
    https://github.com/pr0d1r2/free_disk_space
     
    pr0d1r2, Nov 16, 2013
    #5
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.