From: Alexander Mcconaughey Date: 2009-05-18T16:21:49+09:00 Subject: Re: file grep This can be solved with a begin rescue statement though: begin # File manipulation rescue => e file.close unless file.nil? end Kaldrenon wrote: > On Aug 17, 1:30 pm, Robert Klemme wrote: >> The more compact version does not properly close the file. Although you >> fixed compact version does not close the file if the block is left via >> an exception. > > That's good to know, glad I asked. Thanks! -- Posted via http://www.ruby-forum.com/.