From: Martin Hansen Date: 2010-08-18T20:18:14+09:00 Subject: Re: Making File.open work on gzipped files Thanks Brian and Robert. The below snippet appears to be working nicely - though I am not sure that the file is closed if zipped? class Parser def self.open(*args) ios = File.open(*args) begin ios = Zlib::GzipReader.new(ios) rescue ios.rewind end parse = self.new(ios) if block_given? begin yield parse ensure ios.close end return true else return parse end end end -- Posted via http://www.ruby-forum.com/.