Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!talisker.lacave.net!lacave.net!not-for-mail From: Paul Joyce Newsgroups: comp.lang.ruby Subject: Re: SImple question about file io Date: Fri, 1 Apr 2011 05:21:40 -0500 Organization: Service de news de lacave.net Lines: 18 Message-ID: References: <2f3b59003ad3466c17243f27510084bf@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1301653323 99649 65.111.164.187 (1 Apr 2011 10:22:03 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Fri, 1 Apr 2011 10:22:03 +0000 (UTC) In-Reply-To: <2f3b59003ad3466c17243f27510084bf@ruby-forum.com> X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 380744 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:2099 Hi Haruka Thank you for you help. I guess its a good idea to initialise vars. Adding opf = nil solves the problem, though I must confess to not being entirely sure why, since the initialisation should create it, and as far as I can tell it exists for the rest of the runtime, just closes and re-opens pointing to a different file. I mean the problem arises in the line following the File.new statement that defines opf ??? Anyway - it now works - thats the main thing! thanks again much appreciated Paul -- Posted via http://www.ruby-forum.com/.