<?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"
	>
<channel>
	<title>Comments on: Quick Ruby File Operations</title>
	<atom:link href="http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/</link>
	<description>Coding for the casual coder</description>
	<pubDate>Tue, 06 Jan 2009 03:21:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Brian Real</title>
		<link>http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3301</link>
		<dc:creator>Brian Real</dc:creator>
		<pubDate>Mon, 14 Apr 2008 18:40:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3301</guid>
		<description>Okay sounds good. I tried this creating an .htm document. I was wondering if there is a page to read &#38; write my .htm document and then have browser automatically read and execute the file I wrote. Basically have the browser open the file that my program just wrote.</description>
		<content:encoded><![CDATA[<p>Okay sounds good. I tried this creating an .htm document. I was wondering if there is a page to read &amp; write my .htm document and then have browser automatically read and execute the file I wrote. Basically have the browser open the file that my program just wrote.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesper de Jong</title>
		<link>http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3299</link>
		<dc:creator>Jesper de Jong</dc:creator>
		<pubDate>Sat, 22 Mar 2008 19:03:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3299</guid>
		<description>It's even better if you pass a block to File.open, like I show below. The advantage of this is that you do not need to close the file explicitly - File.open will open the file, execute the code in the block, and then automatically close the file - even when an exception occurs. So it's more convenient and more safe, because you won't have a resource leak in case an exception occurs:

File.open(my_file, 'r') do &#124;f&#124;
    file_data = f.read
end</description>
		<content:encoded><![CDATA[<p>It&#8217;s even better if you pass a block to File.open, like I show below. The advantage of this is that you do not need to close the file explicitly - File.open will open the file, execute the code in the block, and then automatically close the file - even when an exception occurs. So it&#8217;s more convenient and more safe, because you won&#8217;t have a resource leak in case an exception occurs:</p>
<p>File.open(my_file, &#8216;r&#8217;) do |f|<br />
    file_data = f.read<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh</title>
		<link>http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3232</link>
		<dc:creator>Rajesh</dc:creator>
		<pubDate>Wed, 19 Dec 2007 05:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3232</guid>
		<description>Thanks dude</description>
		<content:encoded><![CDATA[<p>Thanks dude</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Devi</title>
		<link>http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3094</link>
		<dc:creator>Devi</dc:creator>
		<pubDate>Wed, 05 Dec 2007 09:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-3094</guid>
		<description>this tip was really helpful. thanks!</description>
		<content:encoded><![CDATA[<p>this tip was really helpful. thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MHM Reddy</title>
		<link>http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-646</link>
		<dc:creator>MHM Reddy</dc:creator>
		<pubDate>Mon, 25 Jun 2007 08:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-646</guid>
		<description>Good info man,  Appreciated.</description>
		<content:encoded><![CDATA[<p>Good info man,  Appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandro</title>
		<link>http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-628</link>
		<dc:creator>Sandro</dc:creator>
		<pubDate>Wed, 20 Jun 2007 12:13:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.casualcode.com/2007/01/05/quick-ruby-file-operations/#comment-628</guid>
		<description>Often this small tips are exactly what a develepor is in search for. This is my case and what I found here completely answer my needs. Thanks.</description>
		<content:encoded><![CDATA[<p>Often this small tips are exactly what a develepor is in search for. This is my case and what I found here completely answer my needs. Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
