Get free disk space under windows with dir command : Utilities « File Directory « Ruby
- Ruby
- File Directory
- Utilities
Get free disk space under windows with dir command
def freespace(device=".")
lines = %x(cmd /c dir #{device}).split("\n")
n = lines.last.split[2].delete(",").to_i
end
puts freespace "C:"
Related examples in the same category