From: Tod Beardsley Date: 2008-09-17T01:51:09+09:00 Subject: Re: check available disk space When dealing with file systems, I usually find myself switching on a File.exists? >> result = (File.exists?('C:\\') ? `dir /-C` : `df .`).split("\n").last => "/dev/sda1 110650276 52580520 52449016 51% /" This assumes only two filesystem styles (Windows and Linux) On Tue, Sep 16, 2008 at 11:17 AM, jim wrote: > 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. > > -- todb@planb-security.net | ICQ: 335082155 | Note: Due to Google's privacy policy and the United States' policy on electronic surveillance , please do not IM/e-mail me anything you wish to remain secret.