<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Finding free disk space in Ruby</title>
	<atom:link href="http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/</link>
	<description>Who Spilled the Java Beans?</description>
	<lastBuildDate>Wed, 28 Jul 2010 15:32:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: bob</title>
		<link>http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/comment-page-1/#comment-774</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Wed, 28 Jul 2010 15:32:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.jayomega.net/blog/?p=177#comment-774</guid>
		<description>&lt;a href=&quot;#comment-773&quot; rel=&quot;nofollow&quot;&gt;@bob &lt;/a&gt; 
piped into tail</description>
		<content:encoded><![CDATA[<p><a href="#comment-773" rel="nofollow">@bob </a><br />
piped into tail</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/comment-page-1/#comment-773</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Wed, 28 Jul 2010 15:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.jayomega.net/blog/?p=177#comment-773</guid>
		<description>...if you&#039;re going to make a system call, then just use du and df.</description>
		<content:encoded><![CDATA[<p>&#8230;if you&#8217;re going to make a system call, then just use du and df.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iulian Dogariu</title>
		<link>http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/comment-page-1/#comment-626</link>
		<dc:creator>Iulian Dogariu</dc:creator>
		<pubDate>Tue, 23 Feb 2010 11:49:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.jayomega.net/blog/?p=177#comment-626</guid>
		<description>Thanks, Martin! I updated the post to incorporate your tip.</description>
		<content:encoded><![CDATA[<p>Thanks, Martin! I updated the post to incorporate your tip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Rehfeld</title>
		<link>http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/comment-page-1/#comment-607</link>
		<dc:creator>Martin Rehfeld</dc:creator>
		<pubDate>Sat, 23 Jan 2010 20:29:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.jayomega.net/blog/?p=177#comment-607</guid>
		<description>Please bear in mind that not every filesystem uses 1k blocks. To make sure you always get sizes calculated with 1k blocks, use df -Pk</description>
		<content:encoded><![CDATA[<p>Please bear in mind that not every filesystem uses 1k blocks. To make sure you always get sizes calculated with 1k blocks, use df -Pk</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iljkmittaa</title>
		<link>http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/comment-page-1/#comment-146</link>
		<dc:creator>iljkmittaa</dc:creator>
		<pubDate>Tue, 14 Jul 2009 17:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.jayomega.net/blog/?p=177#comment-146</guid>
		<description>&quot;Parse&quot; is a fascinating word. I truly believe that. Thanks to mr. Dogariu for reminding it to me.</description>
		<content:encoded><![CDATA[<p>&#8220;Parse&#8221; is a fascinating word. I truly believe that. Thanks to mr. Dogariu for reminding it to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alin</title>
		<link>http://www.iuliandogariu.com/2008/12/finding-free-disk-space-in-ruby/comment-page-1/#comment-35</link>
		<dc:creator>Alin</dc:creator>
		<pubDate>Tue, 16 Dec 2008 17:25:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.jayomega.net/blog/?p=177#comment-35</guid>
		<description>Other version without so many os commands usage:

def disk_space(path, used)
     path_info = `df -P #{path}`.split(&quot;\n&quot;)[1]
     if(used)
         path_info.split(&quot; &quot;)[2].to_i
     else
         path_info.split(&quot; &quot;)[3].to_i
     end
 end

p disk_space(&quot;/&quot;, true) - returns the used space for &quot;/&quot; mount point (bytes)
p disk_space(&quot;/&quot;, false) - returns the available space for &quot;/&quot; mount point (bytes)</description>
		<content:encoded><![CDATA[<p>Other version without so many os commands usage:</p>
<p>def disk_space(path, used)<br />
     path_info = `df -P #{path}`.split(&#8220;\n&#8221;)[1]<br />
     if(used)<br />
         path_info.split(&#8221; &#8220;)[2].to_i<br />
     else<br />
         path_info.split(&#8221; &#8220;)[3].to_i<br />
     end<br />
 end</p>
<p>p disk_space(&#8220;/&#8221;, true) &#8211; returns the used space for &#8220;/&#8221; mount point (bytes)<br />
p disk_space(&#8220;/&#8221;, false) &#8211; returns the available space for &#8220;/&#8221; mount point (bytes)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
