check available disk space

J

jim

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.
 
T

Tod Beardsley

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)
 
D

Daniel Berger

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.

gem install sys-filesystem

Regards,

Dan
 
M

Marc Heiler

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

Shame on my windows-noob head. Ruby is even nice on windows! :)
 
P

pr0d1r2

W dniu wtorek, 16 września 2008 18:23:18 UTC+2 użytkownik jim napisał:
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.

Hi. I have created gem specifically for checking free disk space:
https://github.com/pr0d1r2/free_disk_space
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,089
Latest member
Bobby2025b

Latest Threads

Top